diff options
| author | Frederick Muriuki Muriithi | 2026-02-06 16:59:59 -0600 |
|---|---|---|
| committer | Frederick Muriuki Muriithi | 2026-02-06 16:59:59 -0600 |
| commit | 6f1907292cb2b54b8f18b139480b1837c6f355e0 (patch) | |
| tree | f786398cce207daf39908a124572827e54f8d853 /gn_auth/auth/authorisation/resources | |
| parent | f91869500b0cb2ebeb785ee13464cad9aefba801 (diff) | |
| download | gn-auth-6f1907292cb2b54b8f18b139480b1837c6f355e0.tar.gz | |
Replace hard-coded email check with check against privileges
Fix the check: rather than using a hard-coded email to check for authorisation, we instead check against the privileges the user has on the resource, or whether they have global privileges allowing them to act on any data.
Diffstat (limited to 'gn_auth/auth/authorisation/resources')
| -rw-r--r-- | gn_auth/auth/authorisation/resources/checks.py | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/gn_auth/auth/authorisation/resources/checks.py b/gn_auth/auth/authorisation/resources/checks.py index ce2b821..59bf90c 100644 --- a/gn_auth/auth/authorisation/resources/checks.py +++ b/gn_auth/auth/authorisation/resources/checks.py @@ -1,5 +1,6 @@ """Handle authorisation checks for resources""" import uuid +import logging import warnings from functools import reduce from typing import Sequence @@ -13,6 +14,10 @@ from ...authentication.users import User from ..privileges.models import db_row_to_privilege + +logger = logging.getLogger(__name__) + + def __organise_privileges_by_resource_id__(rows): def __organise__(privs, row): resource_id = uuid.UUID(row["resource_id"]) |
