aboutsummaryrefslogtreecommitdiff
path: root/gn_auth
diff options
context:
space:
mode:
authorFrederick Muriuki Muriithi2023-09-27 10:00:25 +0300
committerFrederick Muriuki Muriithi2023-09-27 10:05:25 +0300
commit938efc6d8d2713d5f8dd399e9c878b95832ac882 (patch)
treef2ef4a742bd5505113b9374973519ac24cd919b4 /gn_auth
parent78eb3fd12e31d22b53c9cdf5b7b0299befd86be3 (diff)
downloadgn-auth-938efc6d8d2713d5f8dd399e9c878b95832ac882.tar.gz
linting: Remove unused import, handle unused variable
Diffstat (limited to 'gn_auth')
-rw-r--r--gn_auth/auth/authorisation/resources/views.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/gn_auth/auth/authorisation/resources/views.py b/gn_auth/auth/authorisation/resources/views.py
index de2fd6c..25f621d 100644
--- a/gn_auth/auth/authorisation/resources/views.py
+++ b/gn_auth/auth/authorisation/resources/views.py
@@ -22,7 +22,7 @@ from .models import (
assign_resource_user, link_data_to_resource, unassign_resource_user,
resource_category_by_id, unlink_data_from_resource,
create_resource as _create_resource)
-from .groups.models import Group, GroupRole, resource_owner, group_role_by_id
+from .groups.models import Group, resource_owner, group_role_by_id
resources = Blueprint("resources", __name__)
@@ -153,9 +153,9 @@ def resource_users(resource_id: uuid.UUID):
"""Retrieve all users with access to the given resource."""
with require_oauth.acquire("profile group resource") as the_token:
def __the_users__(conn: db.DbConnection):
- resource = resource_by_id(conn, the_token.user, resource_id)
authorised = authorised_for(
- conn, the_token.user, ("group:resource:edit-resource",),
+ conn, the_token.user,
+ ("group:resource:edit-resource","group:resource:view-resource"),
(resource_id,))
if authorised.get(resource_id, False):
with db.cursor(conn) as cursor: