diff options
author | Munyoki Kilyungi | 2024-03-19 22:05:56 +0300 |
---|---|---|
committer | Munyoki Kilyungi | 2024-03-21 10:07:08 +0300 |
commit | 7107b2b99058835bf0115955c3e79c23f9fb6bc9 (patch) | |
tree | 37a412d506aa47a213286531b466b2ff85d442ba /gn_auth/auth/authorisation/resources/models.py | |
parent | f7c41fa2f24d96c3024930b1bb603f566f402644 (diff) | |
download | gn-auth-7107b2b99058835bf0115955c3e79c23f9fb6bc9.tar.gz |
Revert "Add an extra endpoint for metadata authorisation."
This reverts commit f5e833c0d72eaec80425203b15210ed304cc4811.
Signed-off-by: Munyoki Kilyungi <me@bonfacemunyoki.com>
Diffstat (limited to 'gn_auth/auth/authorisation/resources/models.py')
-rw-r--r-- | gn_auth/auth/authorisation/resources/models.py | 19 |
1 files changed, 0 insertions, 19 deletions
diff --git a/gn_auth/auth/authorisation/resources/models.py b/gn_auth/auth/authorisation/resources/models.py index 3720baa..8bd8c73 100644 --- a/gn_auth/auth/authorisation/resources/models.py +++ b/gn_auth/auth/authorisation/resources/models.py @@ -2,7 +2,6 @@ from dataclasses import asdict from uuid import UUID, uuid4 from functools import reduce, partial -from sqlite3 import Row from typing import Dict, Sequence, Optional from gn_auth.auth.db import sqlite3 as db @@ -36,22 +35,6 @@ from .phenotype import ( from .errors import MissingGroupError - -def __metadata_resource_data__( - cursor: db.DbCursor, - resource_id: UUID, - offset: int = 0, - limit: Optional[int] = None -) -> Sequence[Row]: - """Fetch metadata resources""" - cursor.execute( - ( - ("SELECT * FROM metadata_resources as mt \ -WHERE mt.resource_id=?") - + (f" LIMIT {limit} OFFSET {offset}" if bool(limit) else "")), - (str(resource_id),)) - return cursor.fetchall() - def __assign_resource_owner_role__(cursor, resource, user, group): """Assign `user` the 'Resource Owner' role for `resource`.""" cursor.execute( @@ -202,7 +185,6 @@ def resource_data(conn, resource, offset: int = 0, limit: Optional[int] = None) "mrna": mrna_resource_data, "genotype": genotype_resource_data, "phenotype": phenotype_resource_data, - "metadata": __metadata_resource_data__, "system": lambda *args: tuple(), "group": lambda *args: tuple() } @@ -309,7 +291,6 @@ def attach_resources_data( "mrna": mrna_attach_resources_data, "genotype": genotype_attach_resources_data, "phenotype": phenotype_attach_resources_data, - "metadata": lambda *args: [], "system": lambda *args: [], "group": lambda *args: [], "inbredset-group": lambda *args: [] |