diff options
author | Frederick Muriuki Muriithi | 2024-10-01 13:28:49 -0500 |
---|---|---|
committer | Frederick Muriuki Muriithi | 2024-10-01 13:28:49 -0500 |
commit | 94513310831875a72d21b3e17af9541a328cabd6 (patch) | |
tree | 8097f74a322c67439a5c4f867d2e362dfd8b9ca0 /uploader/phenotypes | |
parent | 6ca2c1520b1fc6e1472fbc74994e3e136cacdc71 (diff) | |
download | gn-uploader-94513310831875a72d21b3e17af9541a328cabd6.tar.gz |
Extract privileges and use them for access control
Diffstat (limited to 'uploader/phenotypes')
-rw-r--r-- | uploader/phenotypes/views.py | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/uploader/phenotypes/views.py b/uploader/phenotypes/views.py index 7fc3b08..63e0b84 100644 --- a/uploader/phenotypes/views.py +++ b/uploader/phenotypes/views.py @@ -200,7 +200,11 @@ def view_phenotype(# pylint: disable=[unused-argument] "xref_id": xref_id } ).then( - lambda resource: render_template( + lambda resource: tuple( + privilege["privilege_id"] for role in resource["roles"] + for privilege in role["privileges"]) + ).then( + lambda privileges: render_template( "phenotypes/view-phenotype.html", species=species, population=population, @@ -210,7 +214,7 @@ def view_phenotype(# pylint: disable=[unused-argument] population["Id"], dataset["Id"], xref_id), - resource=resource, + privileges=privileges, activelink="view-phenotype") ).either( make_either_error_handler( |