diff options
author | Frederick Muriuki Muriithi | 2024-09-13 13:56:40 -0500 |
---|---|---|
committer | Frederick Muriuki Muriithi | 2024-09-13 13:56:40 -0500 |
commit | e829074e99fd5bec033765d18d5efa55e1edce44 (patch) | |
tree | ddd2430f4e70eb756a9279b88c08b40c890e2a85 /gn_auth/auth | |
parent | e55b5ff63853f1ef489c1e74b6cc0d26f9e230ce (diff) | |
download | gn-auth-e829074e99fd5bec033765d18d5efa55e1edce44.tar.gz |
Notes: Add note on some items that could go into hooks.
Diffstat (limited to 'gn_auth/auth')
-rw-r--r-- | gn_auth/auth/authorisation/resources/models.py | 10 |
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))) |