Websites that fly. Leads that land.

Testing and QA

How to Test User Permissions in a Role-Based Application

Role-based applications show different screens, data and actions to different users. A sales executive sees their own leads, a manager sees the team’s pipeline, finance approves invoices and administrators manage settings. When permissions work, users see exactly what they need. When they fail, the consequences range from frustration, such as staff blocked from doing their jobs, to serious incidents, such as customers seeing other customers’ data or staff approving their own payments. Permission bugs are among the most damaging defects in business software. This guide explains how to test user permissions in a role-based application thoroughly and systematically.

Why Permission Testing Needs Its Own Approach

Functional testing usually checks that features work for a typical user, often an administrator with full access. Permission testing asks the opposite: can each role do only what it should, and nothing more? It must consider every role, every action and every type of data. Testing through the user interface alone is not enough, because hidden buttons can still be reached through direct URLs or API calls.

Step 1: Build a Permission Matrix

List roles as columns and actions as rows, with the expected result for each combination:

ActionViewerStaffManagerFinanceAdmin
View customers (own)YesYesYesYesYes
View customers (all)NoNoTeam onlyYesYes
Create orderNoYesYesNoYes
Approve discount above 10%NoNoYesNoYes
Approve invoiceNoNoNoYesYes
Export customer listNoNoYesYesYes
Manage usersNoNoNoNoYes
Edit system settingsNoNoNoNoYes

This matrix becomes the master reference for testing. It should come from the requirements and be approved by business owners.

Step 2: Include Data Scope

Permissions are not only about actions but also about which records a user can access. Add scope rules: own records, team, branch, region, customer organisation or all. Test that a manager in Mumbai cannot see Delhi records, and that a customer user from Company A cannot see Company B’s orders. Data scope failures often cause the most serious breaches.

Step 3: Create Test Accounts for Every Role

Create dedicated test users for each role and scope combination, with realistic data assigned to them. Include edge cases such as users with multiple roles, users who belong to several teams or organisations, and recently deactivated users.

Step 4: Test User Permissions Through the Interface

For each role:

  • Check which menu items, pages, buttons and fields appear
  • Attempt every action in the matrix
  • Confirm that forbidden actions are hidden or disabled with clear messages
  • Check that lists and reports show only permitted records

Step 5: Test Direct URLs and API Endpoints

This is the step most teams skip, and it is the most important. While logged in as a restricted user:

  • Paste URLs of pages or records the user should not access
  • Change record IDs in URLs, such as /orders/1023 to /orders/1024
  • Call API endpoints directly with the user’s session or token
  • Submit forms with modified hidden fields

Each attempt should be blocked by the server with an appropriate error, and ideally logged. If any succeed, the application relies on hiding things in the interface rather than enforcing permissions. Our website security reviews include these checks.

Step 6: Test Permission Changes

Test what happens when permissions change:

  • A user is promoted from staff to manager
  • A user is moved to a different team or region
  • A user is deactivated while logged in
  • A role’s permissions are edited by an administrator

Changes should take effect promptly, and active sessions should not keep old permissions indefinitely.

Step 7: Test Separation of Duties

Check rules such as “users cannot approve their own requests” or “the person who creates a vendor cannot approve payments to that vendor”. These rules protect against fraud and errors.

Step 8: Test Audit Logging

Confirm that sensitive actions and permission changes are logged with user, time and details. Logs should be accessible only to authorised roles.

Step 9: Automate Permission Tests

Permission matrices are ideal for automated testing. Write tests that log in as each role and attempt each action through the API, comparing results with the matrix. Run them on every release so new features cannot accidentally weaken access control. This is a valuable part of any website testing and QA programme.

Common Permission Bugs

  • Hidden buttons but unprotected endpoints
  • Missing checks on export or report functions
  • Record IDs that can be guessed and accessed
  • Cached pages showing one user’s data to another
  • Permissions checked on reading but not on updating or deleting
  • New features added without updating permission rules

Example: Finding a Hidden Data Leak

During permission testing of a dealer portal, a tester logged in as Dealer A and changed an invoice ID in the download URL. The system returned Dealer B’s invoice PDF. The interface never showed other dealers’ invoices, so functional testing had missed it. The fix added server-side ownership checks to every document endpoint, and automated tests now try cross-dealer access on every release.

Permission Testing in Multi-Tenant and Customer-Facing Portals

Customer portals and multi-tenant platforms raise the stakes, because a permission failure exposes one customer’s data to another company. In these systems, test isolation between organisations as a separate category: every list, search, export, report, file download, notification and API endpoint should be tried across tenants. Include indirect paths too, such as search suggestions, autocomplete results, email notifications and cached reports, which sometimes leak information even when main pages are protected. Test delegated administration, where customer admins manage their own users, to ensure they cannot grant themselves or others access beyond their organisation. Run these tests on every release, not only at launch. Businesses offering SaaS website development products often include tenant isolation tests in security reviews requested by enterprise customers, and healthcare website development projects treat them as mandatory because of patient data sensitivity.

Frequently Asked Questions

How Many Roles Should We Test?

All of them, with priority on roles that handle sensitive data or financial actions.

Should Permission Testing Be Manual or Automated?

Both. Manual testing explores the interface; automated tests protect against regressions.

Who Should Approve the Permission Matrix?

Business owners for each area, with input from security and compliance teams.

Thorough permission testing protects your data, customers and reputation. Explore our web application development, review website backend development, learn about enterprise website development, see finance website development, read our website security guides, check B2B website development, or contact us.

Leave a Reply

Your email address will not be published. Required fields are marked *

Keep reading

Free consultation

Want this done for your website?

Get a free consultation and a fixed quote.

    What do you need?
    Budget and timeline

    Where should we send your quote?

    No spam. Your details are only used to answer your request.

    Chat on WhatsApp