A role describes a set of capabilities but does not prove that a user belongs to the tenant owning a resource. Authorization needs both membership and resource context.
Implementation approach
Resolve the tenant from trusted context, confirm membership, and apply a policy to the specific resource. Use explicit capabilities for operations such as exporting student records or changing billing settings.
Example
Gate::authorize('update', $record);
Validation and edge cases
Create tests for users with the same role in different tenants, suspended members and users whose role changed during a session. Apply the same policy to API and background operations.
Key takeaway
Default to denial when membership or resource ownership cannot be established.




