about summary refs log tree commit diff
path: root/gn_auth/auth/authorisation/groups
diff options
context:
space:
mode:
authorClaude Sonnet 4.62026-08-28 19:00:00 +0000
committerFrederick Muriuki Muriithi2026-08-28 14:51:04 -0500
commit58c6f7a9eedc77c7268dc350387f78f77d619eac (patch)
treec1844964f1157f85a086402a14e343892a2be21e /gn_auth/auth/authorisation/groups
parent3348d266228e1f4b374d0af6e33fe4948eb1bfaa (diff)
downloadgn-auth-main.tar.gz
Implement assign-owner / revoke-owner in system admin resources HEAD main
The system-administrator role carries system:resource:assign-owner
(migration 20250729_02), but no endpoint used it.  Sysadmins had no API
path to bootstrap ownership on a resource that has no owner yet.

Implement two endpoints in gn_auth/auth/system/admin/resources.py
(the blueprint skeleton was already wired in a preceding commit):

  POST /auth/system/administration/resources/<resource_id>/assign-owner
    Body: {"user_id": "<uuid>"}
    Assigns the resource-owner role to the named user on the resource.

  POST /auth/system/administration/resources/<resource_id>/revoke-owner
    Body: {"user_id": "<uuid>"}
    Revokes the resource-owner role from the named user on the resource.

Both check system:resource:assign-owner on the *system* resource, so a
sysadmin can grant/revoke ownership without being resource-owner
themselves.

Reviewed-By: Frederick M. Muriithi <fredmanglis@gmail.com>
Diffstat (limited to 'gn_auth/auth/authorisation/groups')
0 files changed, 0 insertions, 0 deletions