aboutsummaryrefslogtreecommitdiff
path: root/gn3/auth/authorisation
diff options
context:
space:
mode:
authorFrederick Muriuki Muriithi2023-08-02 08:45:23 +0300
committerFrederick Muriuki Muriithi2023-08-02 08:45:23 +0300
commit1bd01c7396daf9413e9524d7e627e9e36b281213 (patch)
treea99b758bc3f598e11b46a95761803570968fb2aa /gn3/auth/authorisation
parentcc5766fe166cb4bf0dbcd18e3b79a39edd3e7c3a (diff)
downloadgenenetwork3-1bd01c7396daf9413e9524d7e627e9e36b281213.tar.gz
Integrate Temp traits to Auth
Temporary traits are not saved to the database, and have no attached resource (at this time). As such, make them all simply public-read to enable access for users. This might change after more information on usage of temporary traits is collected and considered.
Diffstat (limited to 'gn3/auth/authorisation')
-rw-r--r--gn3/auth/authorisation/data/views.py8
1 files changed, 7 insertions, 1 deletions
diff --git a/gn3/auth/authorisation/data/views.py b/gn3/auth/authorisation/data/views.py
index e899bdf..8adf862 100644
--- a/gn3/auth/authorisation/data/views.py
+++ b/gn3/auth/authorisation/data/views.py
@@ -111,6 +111,7 @@ def authorisation() -> Response:
traits_names = args["traits"] # type: ignore[index]
def __translate__(val):
return {
+ "Temp": "Temp",
"ProbeSet": "mRNA",
"Geno": "Genotype",
"Publish": "Phenotype"
@@ -134,7 +135,12 @@ def authorisation() -> Response:
data_to_resource_map.get(
__trait_key__(trait),
uuid.UUID("4afa415e-94cb-4189-b2c6-f9ce2b6a878d")),
- tuple())
+ tuple()) + (
+ # Temporary traits do not exist in db: Set them
+ # as public-read
+ ("system:resource:public-read",)
+ if trait["db"]["dataset_type"] == "Temp"
+ else tuple())
} for trait in
(build_trait_name(trait_fullname)
for trait_fullname in traits_names)))