You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Implement support user permission check in access control #112
Provide a config option that allows users to check their own permissions. In that case, the GET endpoints should be available to the users for any permissions that affect them.
Currently every operation of the permissions API requires admin (AccessControlResolver(enforce_all=True)). We would add an opt-in, read-only self-service view:
New config flag security.access_control.self_service: bool = False.
If enabled, any authenticated user may call GET /permissions and GET /permissions/{id}, but non-admins only see rules that apply to them: rules whose subject is their prefixed subject (user:<sub>), one of their roles/groups (get_current_groups()), or *, plus g/g2 assignments of their subject. Requesting another subject's rule by ID returns 404 (not 403), so rule IDs are not leaked.
This does not affect how resource owners manage access to their resources: apps expose their own endpoints for that (e.g., /services/{id}/permissions), enforced via resource-scoped roles and implemented with add_resource_role(), list_resource_roles() and remove_resource_role(), so owners can grant and revoke other users' roles on their resources without admin rights or self-service.
Implementation: the resolver lets the two GET operations through to the controller when the flag is on; the controller filters (single query on v0), so no extra policies need to be stored.
Acceptance criteria
Flag off: behaviour unchanged (non-admins get 403) (test).
Flag on: a non-admin sees only their own rules in list and get; another user's rule ID yields 404; write operations still yield 403 (tests).
Activity
uniqueg commentedon Oct 18, 2026
Refined proposal
Currently every operation of the permissions API requires
admin(AccessControlResolver(enforce_all=True)). We would add an opt-in, read-only self-service view:security.access_control.self_service: bool = False.GET /permissionsandGET /permissions/{id}, but non-admins only see rules that apply to them: rules whose subject is their prefixed subject (user:<sub>), one of their roles/groups (get_current_groups()), or*, plusg/g2assignments of their subject. Requesting another subject's rule by ID returns 404 (not 403), so rule IDs are not leaked./services/{id}/permissions), enforced via resource-scoped roles and implemented withadd_resource_role(),list_resource_roles()andremove_resource_role(), so owners can grant and revoke other users' roles on their resources without admin rights or self-service.v0), so no extra policies need to be stored.Acceptance criteria
GETmethods #113 (test).*.Breaking changes
None (opt-in).
Planned PR
4 (
refactor(access-control): tidy permissions API).