aboutsummaryrefslogtreecommitdiff
path: root/gn3
diff options
context:
space:
mode:
authorFrederick Muriuki Muriithi2022-12-08 08:32:26 +0300
committerFrederick Muriuki Muriithi2022-12-08 08:35:42 +0300
commitb408d90f52766861071b6fefe01f8bf9d213432e (patch)
tree0a410830acdec6e3e25b33bb16a4255d15074fc5 /gn3
parent836924e7dccddaceb036fe3a312ca6811ccf2228 (diff)
downloadgenenetwork3-b408d90f52766861071b6fefe01f8bf9d213432e.tar.gz
auth: test for `user_resources` function (incomplete)
* gn3/auth/authorisation/resources.py: dummy `user_resources` function * tests/unit/auth/conftest.py: (incomplete): Add some fixtures for testing the `user_resources` function * tests/unit/auth/test_resources.py: test the `user_resources` function
Diffstat (limited to 'gn3')
-rw-r--r--gn3/auth/authorisation/resources.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/gn3/auth/authorisation/resources.py b/gn3/auth/authorisation/resources.py
index 095a72c..2c0b72b 100644
--- a/gn3/auth/authorisation/resources.py
+++ b/gn3/auth/authorisation/resources.py
@@ -3,6 +3,8 @@ from uuid import UUID, uuid4
from typing import Sequence, NamedTuple
from gn3.auth import db
+from gn3.auth.authentication.users import User
+
from .checks import authorised_p
from .exceptions import AuthorisationError
from .groups import Group, authenticated_user_group
@@ -70,3 +72,7 @@ def public_resources(conn: db.DbConnection) -> Sequence[Resource]:
Resource(groups[row[0]], UUID(row[1]), row[2], categories[row[3]],
bool(row[4]))
for row in results)
+
+def user_resources(conn: db.DbConnection, user: User) -> Sequence[Resource]:# pylint: disable=[unused-argument]
+ """List the resources available to the user"""
+ return tuple()