Best practice · AI coding & owned software
Test Your App’s Permissions with Two Customer Accounts
Use a simple two-customer test to catch access mistakes that a successful admin demo will never reveal.
Your new customer portal works when you sign in as the administrator. You can open an invoice, download a file, and update a project. That proves the happy path for a powerful account. It does not prove that one customer cannot reach another customer's information. A second ordinary account is one of the most useful additions to your test setup.
Create a small, recognizable test world
Make two fictional customers with clearly different records. Customer North has one project and a file labeled North sample. Customer South has a different project and a South sample. Use synthetic information so a failed test does not expose a real customer's data.
Create an ordinary user for each customer and an administrator. Record what each role should be able to read and change. Include files, exports, comments, and search results. Permissions often reach beyond the page that first comes to mind when someone says customer portal.
Try the other customer’s direct link
While signed in as North, copy a project link belonging to South into the browser. The expected result is a clear denial or a not-found response that reveals no protected content. Hiding South's project from the navigation is useful, but the server must enforce access when the link is requested directly.
OWASP recommends checking authorization on every request. Apply that idea to the actual data operations: loading a record, saving an edit, creating an export, and obtaining a download. A check on the surrounding page does not automatically protect each underlying endpoint.
Test writes as well as reads
Ask a developer or coding assistant to exercise the update request using the other customer's record identifier. The request should fail without changing the destination record. Check the data afterward; an error message alone is not proof that no partial write happened.
Repeat for attachments and comments. A portal can correctly protect the main project while accepting a comment associated with a project the user does not own. The test should follow the relationship between records, not just the role printed on the user's profile.
Include role changes and expired access
Remove North's access and retry an already-open page, a saved download link, and an edit request. Decide what should happen to existing sessions and temporary links. If the design intentionally allows a link to remain valid until it expires, document that behavior and make sure it fits the use case.
Also test a signed-out browser. This catches routes that accidentally depend on the administrator's session during a demonstration. Use separate browser profiles so switching accounts does not quietly reuse cookies from the previous test.
Keep the checks with the feature
Save the permission matrix and the repeatable checks beside your other acceptance criteria. Rerun them when you change roles, sharing, or record ownership. Start with one sensitive resource today. Proving that the wrong person cannot read or change it is as much a part of the feature as proving that the right person can.