about summary refs log tree commit diff
path: root/gn_auth/auth/authorisation/resources/inbredset/models.py
diff options
context:
space:
mode:
Diffstat (limited to 'gn_auth/auth/authorisation/resources/inbredset/models.py')
-rw-r--r--gn_auth/auth/authorisation/resources/inbredset/models.py31
1 files changed, 1 insertions, 30 deletions
diff --git a/gn_auth/auth/authorisation/resources/inbredset/models.py b/gn_auth/auth/authorisation/resources/inbredset/models.py
index 3bc65d2..2626f3e 100644
--- a/gn_auth/auth/authorisation/resources/inbredset/models.py
+++ b/gn_auth/auth/authorisation/resources/inbredset/models.py
@@ -5,37 +5,8 @@ from typing import Sequence, Optional
 import sqlite3
 
 import gn_auth.auth.db.sqlite3 as db
-from gn_auth.auth.errors import NotFoundError
 from gn_auth.auth.authentication.users import User
-from gn_auth.auth.authorisation.resources.groups.models import Group
-from gn_auth.auth.authorisation.resources.base import Resource, ResourceCategory
-from gn_auth.auth.authorisation.resources.models import (
-    create_resource as _create_resource)
-
-def create_resource(
-        cursor: sqlite3.Cursor,
-        resource_name: str,
-        user: User,
-        group: Group,
-        public: bool
-) -> Resource:
-    """Convenience function to create a resource of type 'inbredset-group'."""
-    cursor.execute("SELECT * FROM resource_categories "
-                   "WHERE resource_category_key='inbredset-group'")
-    category = cursor.fetchone()
-    if category:
-        return _create_resource(cursor,
-                                resource_name,
-                                ResourceCategory(
-                                    resource_category_id=UUID(
-                                        category["resource_category_id"]),
-                                    resource_category_key="inbredset-group",
-                                    resource_category_description=category[
-                                        "resource_category_description"]),
-                                user,
-                                group,
-                                public)
-    raise NotFoundError("Could not find a 'inbredset-group' resource category.")
+from gn_auth.auth.authorisation.resources.base import Resource
 
 
 def assign_inbredset_group_owner_role(