Serksa
All Concepts
Security

Authorization Explained

1

What is it?

<strong>Authorization</strong> determines what an authenticated user is allowed to do. It's about permissions and access control, not identity.

2

Think of it like...

The Hotel Key Card

Your hotel key card proves who you are (authentication), but only opens certain doors (authorization).

🔑

Authentication

Proves you're a guest

🚪

Authorization

Which rooms you can enter

🚫

Forbidden

Can't access everything

3

Visual Flow

👤User

Logged in

🔐Check Permissions

Can they do this?

Allowed

Proceed

4

Where you see it

1

User Authenticated

System knows who you are

2

User Attempts Action

Try to delete a post, view admin panel, etc.

3

Check Permissions

Does this user have the right role/permission?

4

Grant or Deny

Allow action or return 403 Forbidden

5

Log Action

Record who did what for security audit

5

Common Mistake

Wrong

If you're logged in, you can do anything

Correct

Authentication (login) proves who you are. Authorization determines what you can do. A regular user can't delete other people's posts even though they're logged in.

💡 Real-World Example

Google Docs permissions:

1

Authentication: You log in with Google account

2

Authorization: Owner can delete, Editor can edit, Viewer can only read

3

You try to delete a doc you don't own → 403 Forbidden

4

You try to edit a doc where you're a Viewer → Not allowed

5

Same person, different permissions for different documents