about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--gn_auth/auth/authorisation/data/phenotypes.py4
-rw-r--r--gn_auth/auth/authorisation/resources/views.py10
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.")