Write down the intended permissions
List the roles in the application and the actions each role can perform. Include read, create, update, delete, export and administrative actions. Record which records each role should see.
Keep the rules close to the product design. If no one can explain why a role has a permission, review whether the permission is still needed.
Test with accounts that have different rights
Use separate test accounts for an owner, standard user and administrator. Try each important action while signed in as each role. Check the server response, not only which buttons appear in the page.
Test direct URLs, API calls, exports and nested records. A user should not gain access by changing an identifier or replaying a request from a more privileged account.
Keep the rules consistent
Enforce permissions on the server for every request. Add automated checks for allowed and denied actions. Review the tests when a new role or feature changes the access model.
A web application penetration test can examine access control across agreed user journeys and provide evidence for fixes and retesting.
