Module 74: Authentication and Authorisation

Lesson 4 of 5 · 15–25 minutes

Roles and permissions

🏠The everyday picture

In a hospital, nurses can read charts, doctors can write prescriptions, pharmacists can dispense, and the accounts office sees bills but not diagnoses. Each role gets what its job needs.

📘What it really is

🖱️Try it

Make a permissions table for your CRM: rows are roles, columns are actions, cells yes or no. Then test it: log in as a viewer and try, with curl or the browser's network tools, to delete a customer, change your own role, and read a customer from another branch by changing the ID. Write an automated test for each refusal. Fix any that succeed.

✅Quick check

Is hiding the "Delete" button from staff enough to stop them deleting?

Show the answer

No. The server must check the permission on every request, because the API can be called directly.

What's an IDOR vulnerability?

Show the answer

Being able to reach another user's data simply by changing an ID in the request, because the server doesn't check ownership.

← PreviousSessions and tokens
ProLearners Assist