about summary refs log tree commit diff
path: root/gn_auth/auth/authorisation/resources/groups/models.py
diff options
context:
space:
mode:
Diffstat (limited to 'gn_auth/auth/authorisation/resources/groups/models.py')
-rw-r--r--gn_auth/auth/authorisation/resources/groups/models.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/gn_auth/auth/authorisation/resources/groups/models.py b/gn_auth/auth/authorisation/resources/groups/models.py
index 3189302..e027b2c 100644
--- a/gn_auth/auth/authorisation/resources/groups/models.py
+++ b/gn_auth/auth/authorisation/resources/groups/models.py
@@ -359,6 +359,9 @@ def remove_user_from_group(
             "DELETE FROM group_users "
             "WHERE group_id=:group_id AND user_id=:user_id",
             {"group_id": str(group.group_id), "user_id": str(user.user_id)})
+        cursor.execute(
+            "DELETE FROM user_roles WHERE user_id=? AND resource_id=?",
+            (str(user.user_id), str(grp_resource.resource_id)))
         assign_user_role_by_name(cursor,
                                  user,
                                  grp_resource.resource_id,