A user can sign in and still lack permission for a particular action. Authorization is the decision about whether a specified account can take an action on a resource.
Web Security · Lesson 6
Authorization
Learn to compare an authenticated user's request with an application's access policy.
Reading a Policy
A role is a named group of permissions. This practice policy governs a preview service.
Role View published page Edit draft
Reader Yes No
Editor Yes Yes
Read the row for the user's role and the column for the requested operation. An editor can view the published page and edit a draft. A reader can view the published page.
A signed-in reader asks to edit a draft. What does the table say?
Checking the Right Resource
Many systems grant different rights for different resources. An editor could be allowed to change drafts in their own project while viewing only another project's pages. The check should identify both the operation and the target resource.
Maya can edit Project A. What evidence decides whether she can edit Project B?
Checking at the Service
A user interface may hide editing controls from readers. The server should still enforce its policy whenever it receives a request. Test expected allowed and denied cases through normal approved actions for the practice service.
An application hides the Edit button for readers. Where should its access decision also be enforced?
Lesson complete
You finished Authorization
You can now reason about an application access decision.
Match the account's role to the requested action.
Include the specific resource in the check.
Verify that the service enforces its policy on requests.
Keep your learning progress
Create a free account to save this lesson and continue learning on any device.
Create a free account