Developer security mini-course

Lesson 3: Server-side Access Control and Tenant Isolation

Learn server-side access control for functions, objects and tenants. Use a permission matrix and practical exercise to check allowed and denied actions.

Server-side access control decides whether the current user may perform a particular action on a particular resource. Authentication supplies an identity; authorisation must apply the permissions relevant to each request.

Authorisation regression checks help keep those decisions correct as routes, roles and workflows change. They need to verify denied actions as well as successful ones.

Learning outcome

You should be able to describe a permission decision using the actor, action, resource and context, then identify where the application enforces it.

For an invoice download, the questions can include whether the account is active, whether the user belongs to the right tenant and whether the role may read that invoice. A hidden button supplies no protection against a direct request.

Separate function and object permissions

A user may be allowed to open the invoice feature without being allowed to retrieve every invoice. An administrator in one customer tenant may still have no rights in another tenant.

CheckExample
Function permissionMay this role approve an invoice?
Object permissionDoes this invoice belong to a customer the user may access?
Property permissionMay this role change the bank account field?
State ruleIs approval permitted for this invoice in its current state?
Relationship ruleMay the requester also approve the same transaction?

Record these rules with the product owner. Code cannot reliably enforce a permission model that nobody has defined.

Enforce decisions at the trusted boundary

Deny access unless the relevant rule permits it. Use central policy mechanisms where they improve consistency, while ensuring every route and background operation actually invokes the required checks.

Scope data queries to the current user or tenant where appropriate. Derive trusted identity and role information from the authenticated server context, rather than accepting a client-supplied role or owner field.

Opaque or random identifiers can reduce easy guessing, but they do not replace permission checks. The service should remain protected when an identifier becomes known through a legitimate route.

Include alternative paths

Downloads, exports, search indexes, bulk actions and background tasks can bypass the controls used by the main page if they implement access separately.

Check create and update operations for protected properties. A request may contain fields the interface never displays, so bind or permit only the values the user may actually change.

Build a small permission matrix

For each sensitive operation, list representative users and expected outcomes. Include another user in the same tenant, a different tenant, a restricted role and an unauthenticated caller where relevant.

Use controlled records to verify both the response and any side effects. An error response is insufficient if a background task still sends the document or changes a record.

Review exercise

Choose one read operation, one update and one export. For each, record the intended permission, the enforcement point and the result for each test user.

Investigate any inconsistent result in the shared policy or data access layer, then check related routes. Fixing the reported URL alone can leave the same missing check in another feature.

Retain meaningful negative tests for the permission boundaries. Review them whenever a new role, delegated access feature or tenant relationship is added.

Read our Testing methodology to discuss coverage, or Book a demo with the systems and objectives you have in mind.

See your first test report this week.

Book a 30 minute demo. We will verify one of your targets with you and run a test against it, so you can judge the results on your own systems.

Book a demo