about summary refs log tree commit diff
path: root/gn_auth/errors/__init__.py
diff options
context:
space:
mode:
authorClaude2026-09-01 15:12:40 +0000
committerFrederick Muriuki Muriithi2026-09-01 10:20:50 -0500
commitf39ff35feee1a9f39149241c053ce2d003d3bfee (patch)
tree4ccc841fe6b536117e8e156457d504670a95ed73 /gn_auth/errors/__init__.py
parent2b9138c932b19da3f1fd42bc1c5f4ca068d1a2b5 (diff)
downloadgn-auth-f39ff35feee1a9f39149241c053ce2d003d3bfee.tar.gz
refactor(auth): migrate authorised_for/2 -> authorised_for_spec
Replace all uses of the deprecated authorised_for() and authorised_for2()
helpers with authorised_for_spec() across resources/views.py and
data/phenotypes.py.

- resources/views.py (resource_users HACK block): two authorised_for()
  calls replaced; the intermediate dict merge collapsed into a plain
  boolean since authorised_for_spec returns bool directly.
- resources/views.py (assign_role_to_user, unassign_role_to_user):
  authorised_for() was called but its return value was discarded, making
  the check a silent no-op. Now replaced with authorised_for_spec() and
  a proper if/raise guard. Also fixes a typo: the privilege string was
  "resource:role:assign-role" (non-existent); corrected to the real
  privilege "resource:user:assign-role".
- resources/views.py (unassign_resource_role_privilege): direct
  replacement; intermediate _authorised variable removed.
- data/phenotypes.py (link_phenotype_data): two authorised_for2() calls
  replaced; .resource_id extracted from the Resource objects to satisfy
  authorised_for_spec's UUID argument. User type annotation added.

Reivewed-By: Frederick M. Muriithi <fredmanglis@gmail.com>
Diffstat (limited to 'gn_auth/errors/__init__.py')
0 files changed, 0 insertions, 0 deletions