I'm a bit confused about role management in web applications.
Assumption: user belongs to a role, one role has one or more permissions, and permission could be: view page options.html.
If role consists of permissions (view this page, view that page, etc..), how should we check which page is user allowed to see in our code?
Two options have crossed my mind:
a)Role level: If user is member of thatRole then show page ...
b)Permission level: if user has permissionToViewThatPage then show page...
If a) is the way to go, then why do we need permissions?
Admin role has the permission to view that page, and later on someone comes and changes permission.
In our code we ask if user is member of the admin role, but we don't check the permission.
Question:
How do you manage user roles/permissions in your source code (JSP/JSF, ASP.NET)?