-
Notifications
You must be signed in to change notification settings - Fork 2
Con2 251 add role guards to remaining controllers #336
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Con2 251 add role guards to remaining controllers #336
Conversation
This pull request has been ignored for the connected project Preview Branches by Supabase. |
Nice work! 😄 There are 2 tiny issues: backend/src/modules/organization-locations/organization_locations.controller.ts: also here: |
backend/src/modules/organization-locations/organization_locations.controller.ts: backend/src/modules/storage-items/storage-items.controller.ts |
if you point it out like that it makes sense. |
This pull request refines role-based access control across the backend by removing the deprecated
superVera
role and standardizing role checks and endpoint protection. It also enhances security by consistently requiring organization membership for elevated actions and expands public access for certain data retrieval endpoints.Role Management and Security Enhancements:
superVera
role from code, role checks, and endpoint guards, ensuring only valid roles are used for authorization. [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11] [12] [13] [14]tenant_admin
,storage_manager
,super_admin
) to also require users to belong to the same organization (sameOrg: true
), improving security and correct scoping of permissions. [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11] Fb4eb006L107R107, Fb4eb006L125R125, Fb4eb006L138R138, Fb4eb006L91R91)@Roles
decorator for all endpoints, ensuring consistent and explicit role checks across controllers. [1] [2] [3]Public Endpoint Improvements:
@Public()
decorator, allowing unauthenticated access for these resources. [1] [2]Role Controller Updates:
role.controller.ts
, ensuring only authorized users can query or modify role assignments and organization-role relationships. [1] [2] [3] [4] [5] [6] [7] [8]These changes collectively improve security, clarify role boundaries, and make endpoint access more predictable for both developers and users.