From 1bd01c7396daf9413e9524d7e627e9e36b281213 Mon Sep 17 00:00:00 2001 From: Frederick Muriuki Muriithi Date: Wed, 2 Aug 2023 08:45:23 +0300 Subject: 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. --- gn3/auth/authorisation/data/views.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'gn3/auth') 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))) -- cgit v1.2.3