aboutsummaryrefslogtreecommitdiff
path: root/gn_auth
diff options
context:
space:
mode:
authorFrederick Muriuki Muriithi2024-09-13 13:56:40 -0500
committerFrederick Muriuki Muriithi2024-09-13 13:56:40 -0500
commite829074e99fd5bec033765d18d5efa55e1edce44 (patch)
treeddd2430f4e70eb756a9279b88c08b40c890e2a85 /gn_auth
parente55b5ff63853f1ef489c1e74b6cc0d26f9e230ce (diff)
downloadgn-auth-e829074e99fd5bec033765d18d5efa55e1edce44.tar.gz
Notes: Add note on some items that could go into hooks.
Diffstat (limited to 'gn_auth')
-rw-r--r--gn_auth/auth/authorisation/resources/models.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/gn_auth/auth/authorisation/resources/models.py b/gn_auth/auth/authorisation/resources/models.py
index c7c8352..501ab91 100644
--- a/gn_auth/auth/authorisation/resources/models.py
+++ b/gn_auth/auth/authorisation/resources/models.py
@@ -84,6 +84,16 @@ def create_resource(
resource_name,
str(resource.resource_category.resource_category_id),
1 if resource.public else 0))
+ # TODO: @fredmanglis,@rookie101
+ # 1. Move the actions below into a (the?) hooks system
+ # 2. Do more checks: A resource can have varying hooks depending on type
+ # e.g. if mRNA, pheno or geno resource, assign:
+ # - "resource-owner"
+ # if inbredset-group, assign:
+ # - "resource-owner",
+ # - "inbredset-group-owner" etc.
+ # if resource is of type "group", assign:
+ # - group-leader
cursor.execute("INSERT INTO resource_ownership (group_id, resource_id) "
"VALUES (?, ?)",
(str(group.group_id), str(resource.resource_id)))