Authorization

التفويض (Authorization)

GLS-000101

Beginnerauth-security1 min read
authzaccess controlpermissions checkrole checkis allowed

Definition

Checking what an authenticated user is allowed to do — after they've proven who they are.

التحقق مما يُسمح للمستخدم المُصادَق عليه بفعله — بعد إثبات هويته.

Why It Matters

Without authorization, any authenticated user could trigger admin actions — like rebuilding the knowledge index or seeding the database.

بدون التفويض، يمكن لأي مستخدم مُصادَق عليه تشغيل إجراءات المشرف — مثل إعادة بناء فهرس المعرفة أو بذر قاعدة البيانات.

Full Definition

Authorization determines what actions a user can perform. Authentication answers 'who are you?' — authorization answers 'what can you do?'. On 404Fault, only admin users can access /admin pages (authorization check). Any signed-in user can bookmark projects. Guests cannot access protected pages. Authorization is enforced in Middleware, API route guards, and Firestore Security Rules.
التفويض يُحدِّد ما يمكن للمستخدم فعله. المصادقة تجيب على 'من أنت؟' — التفويض يجيب على 'ماذا يمكنك فعل؟'. في 404Fault، المشرفون فقط يمكنهم الوصول إلى صفحات /admin (فحص التفويض). أي مستخدم مسجّل يمكنه حفظ الإشارات المرجعية للمشاريع. الزوار لا يمكنهم الوصول إلى الصفحات المحمية. يُطبَّق التفويض في Middleware وحراس مسارات API وقواعد أمان Firestore.

Example Usage

verifyAdminRequest() in every /api/admin/* route checks that the caller has the admin role before allowing the operation.

verifyAdminRequest() في كل مسار /api/admin/* يتحقق أن المُستدعي لديه دور المشرف قبل السماح بالعملية.

Knowledge Graph

Avoid these mistakes when using Authorization:

1

Confusing authentication with authorization

2

Only checking authorization on the frontend (client-side checks can be bypassed — always check server-side)

Sign in to unlock guided AI explanations from AI Teacher.

Generate a Prompt

Copy this prompt and use it directly with any AI model — no setup needed.

Ready-to-Use Prompt
Help me build a project using Authorization.

Explain:
1. What is Authorization and why it matters
2. The core architecture and required tools
3. Step-by-step implementation plan
4. Common mistakes to avoid: Confusing authentication with authorization, Only checking authorization on the frontend (client-side checks can be bypassed — always check server-side)
5. Best practices and production tips

Official Resources