Skip to content

Implement support user permission check in access control #112

Closed

Description

@kushagra189

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.

Activity

  1. added
    priority: low
    status flag: discuss
    status: blocked
    type: feature
    workload: days
    on Jan 29, 2022
  2. self-assigned this
    on Jan 29, 2022
  3. moved this to Todo access control in FOCA releaseon Dec 2, 2023
  4. added this to the v1.0.0 milestone on Dec 2, 2023
  5. uniqueg commented on Oct 18, 2026

    @uniqueg
    Member

    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:

    • 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.
    • Admins keep seeing everything. Write operations remain admin-only.
    • 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).
    • Works together with pagination from Implement pagination for access control GET methods #113 (test).
    • Documented in the access control guide, including what "applies to them" means for groups and *.
    • Test that resource owners can still grant and revoke other users' roles on their resources via resource-scoped roles, with self-service on and off.

    Breaking changes
    None (opt-in).

    Planned PR
    4 (refactor(access-control): tidy permissions API).

  6. moved this from Todo access control to Done in FOCA releaseon Oct 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    priority: lowstatus flag: discussstatus: blockedtype: featureworkload: days

    Type

    No type

    Projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions