From e829074e99fd5bec033765d18d5efa55e1edce44 Mon Sep 17 00:00:00 2001 From: Frederick Muriuki Muriithi Date: Fri, 13 Sep 2024 13:56:40 -0500 Subject: Notes: Add note on some items that could go into hooks. --- gn_auth/auth/authorisation/resources/models.py | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'gn_auth/auth/authorisation/resources') 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))) -- cgit v1.2.3