aboutsummaryrefslogtreecommitdiff
path: root/gn3/auth/authorisation/roles
diff options
context:
space:
mode:
authorFrederick Muriuki Muriithi2023-03-07 13:53:29 +0300
committerFrederick Muriuki Muriithi2023-03-07 13:53:29 +0300
commit8621b737b01be5a6f238725c65771dea1410f0bb (patch)
tree925e050d6f7e02e550553f12e663077a84e8da97 /gn3/auth/authorisation/roles
parenta3a87ae52200cca7586b64d4e15cb12c88b17cd7 (diff)
downloadgenenetwork3-8621b737b01be5a6f238725c65771dea1410f0bb.tar.gz
auth: group_roles: Enable addition/deletion of privileges
Diffstat (limited to 'gn3/auth/authorisation/roles')
-rw-r--r--gn3/auth/authorisation/roles/models.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/gn3/auth/authorisation/roles/models.py b/gn3/auth/authorisation/roles/models.py
index bb7ea73..be04985 100644
--- a/gn3/auth/authorisation/roles/models.py
+++ b/gn3/auth/authorisation/roles/models.py
@@ -17,7 +17,7 @@ class Role(NamedTuple):
"""Class representing a role: creates immutable objects."""
role_id: UUID
role_name: str
- privileges: Iterable[Privilege]
+ privileges: tuple[Privilege, ...]
def dictify(self) -> dict[str, Any]:
"""Return a dict representation of `Role` objects."""
@@ -44,7 +44,7 @@ def create_role(
RETURNS: An immutable `gn3.auth.authorisation.roles.Role` object
"""
- role = Role(uuid4(), role_name, privileges)
+ role = Role(uuid4(), role_name, tuple(privileges))
cursor.execute(
"INSERT INTO roles(role_id, role_name) VALUES (?, ?)",