From 6c077671e9afdb4921e72d0a3018e3d8dedada8b Mon Sep 17 00:00:00 2001 From: Frederick Muriuki Muriithi Date: Mon, 12 Dec 2022 13:26:28 +0300 Subject: auth: Attach group to GroupRole, rather than group_id --- gn3/auth/authorisation/groups.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'gn3') diff --git a/gn3/auth/authorisation/groups.py b/gn3/auth/authorisation/groups.py index 743e812..cda11b3 100644 --- a/gn3/auth/authorisation/groups.py +++ b/gn3/auth/authorisation/groups.py @@ -22,6 +22,7 @@ class Group(NamedTuple): class GroupRole(NamedTuple): """Class representing a role tied/belonging to a group.""" group_role_id: UUID + group: Group role: Role class MembershipError(AuthorisationError): @@ -81,7 +82,7 @@ def create_group_role( "VALUES(?, ?, ?)"), (str(group_role_id), str(group.group_id), str(role.role_id))) - return GroupRole(group_role_id, role) + return GroupRole(group_role_id, group, role) @authenticated_p def authenticated_user_group(conn) -> Maybe: -- cgit v1.2.3