diff options
| author | Frederick Muriuki Muriithi | 2026-09-01 10:56:21 -0500 |
|---|---|---|
| committer | Frederick Muriuki Muriithi | 2026-09-01 11:01:09 -0500 |
| commit | 1cf8351219ebf59bdec38dff741c726deb2bb368 (patch) | |
| tree | 8bea08faa89ad314903d1500657a6b1fec7a65b8 /gn_auth | |
| parent | aab9408e8c1641c0552e51e1c9f6ebd8804f00cc (diff) | |
| download | gn-auth-1cf8351219ebf59bdec38dff741c726deb2bb368.tar.gz | |
Bugfix: Use correct spec strings.
These bugs were introduced by Claude, and I missed them during review.
Diffstat (limited to 'gn_auth')
| -rw-r--r-- | gn_auth/auth/authorisation/data/phenotypes.py | 4 | ||||
| -rw-r--r-- | gn_auth/auth/authorisation/resources/views.py | 10 |
2 files changed, 7 insertions, 7 deletions
diff --git a/gn_auth/auth/authorisation/data/phenotypes.py b/gn_auth/auth/authorisation/data/phenotypes.py index 08d225d..bc9a6f7 100644 --- a/gn_auth/auth/authorisation/data/phenotypes.py +++ b/gn_auth/auth/authorisation/data/phenotypes.py @@ -102,13 +102,13 @@ def link_phenotype_data( authconn, user.user_id, system_resource(authconn).resource_id, - "system:data:link-to-group") + "(AND system:data:link-to-group)") or authorised_for_spec( authconn, user.user_id, group_resource(authconn, group.group_id).resource_id, - "group:data:link-to-group") + "(AND group:data:link-to-group)") ): raise AuthorisationError( "You do not have sufficient privileges to link data to group " diff --git a/gn_auth/auth/authorisation/resources/views.py b/gn_auth/auth/authorisation/resources/views.py index bdcc803..b8c7e24 100644 --- a/gn_auth/auth/authorisation/resources/views.py +++ b/gn_auth/auth/authorisation/resources/views.py @@ -259,12 +259,12 @@ def resource_users(resource_id: UUID): conn, the_token.user.user_id, resource_id, - "group:resource:view-resource") + "(AND group:resource:view-resource)") or authorised_for_spec( conn, the_token.user.user_id, system_resource(conn).resource_id, - "system:user:list")): + "(AND system:user:list)")): raise AuthorisationError( "You do not have sufficient privileges to view the resource " "users.") @@ -332,7 +332,7 @@ def assign_role_to_user(resource_id: UUID) -> Response: conn, _token.user.user_id, resource_id, - "resource:user:assign-role"): + "(AND resource:user:assign-role)"): raise AuthorisationError( "You are not authorised to assign roles on this resource.") resource = resource_by_id(conn, _token.user, resource_id) @@ -375,7 +375,7 @@ def unassign_role_to_user(resource_id: UUID) -> Response: conn, _token.user.user_id, resource_id, - "resource:user:assign-role"): + "(AND resource:user:assign-role)"): raise AuthorisationError( "You are not authorised to assign roles on this resource.") resource = resource_by_id(conn, _token.user, resource_id) @@ -662,7 +662,7 @@ def unassign_resource_role_privilege(resource_id: UUID, role_id: UUID): conn, _token.user.user_id, resource_id, - "resource:role:edit-role"): + "(AND resource:role:edit-role)"): raise AuthorisationError( "You are not authorised to edit/update this role.") |
