From 361a934d1c0d75da01bd19d8ac78bf15aa7e2cad Mon Sep 17 00:00:00 2001 From: Frederick Muriuki Muriithi Date: Mon, 6 Mar 2023 15:19:35 +0300 Subject: auth: privileges/roles: fix issues caught by tests. --- migrations/auth/20230306_01_pRfxl-add-system-user-list-privilege.py | 2 +- ...ser-list-privilege-to-system-administrator-and-group-leader-roles.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'migrations/auth') diff --git a/migrations/auth/20230306_01_pRfxl-add-system-user-list-privilege.py b/migrations/auth/20230306_01_pRfxl-add-system-user-list-privilege.py index 0393cd3..17db17c 100644 --- a/migrations/auth/20230306_01_pRfxl-add-system-user-list-privilege.py +++ b/migrations/auth/20230306_01_pRfxl-add-system-user-list-privilege.py @@ -12,7 +12,7 @@ def insert_users_list_priv(conn): with contextlib.closing(conn.cursor()) as cursor: cursor.execute( "INSERT INTO privileges(privilege_id, privilege_description) " - "VALUES('system:user:list', 'List users in the system.') " + "VALUES('system:user:list', 'List users in the system') " "ON CONFLICT (privilege_id) DO NOTHING") def delete_users_list_priv(conn): diff --git a/migrations/auth/20230306_02_7GnRY-add-system-user-list-privilege-to-system-administrator-and-group-leader-roles.py b/migrations/auth/20230306_02_7GnRY-add-system-user-list-privilege-to-system-administrator-and-group-leader-roles.py index 4cfd068..3caad55 100644 --- a/migrations/auth/20230306_02_7GnRY-add-system-user-list-privilege-to-system-administrator-and-group-leader-roles.py +++ b/migrations/auth/20230306_02_7GnRY-add-system-user-list-privilege-to-system-administrator-and-group-leader-roles.py @@ -35,7 +35,7 @@ def del_privilege_from_roles(conn): cursor.execute( "DELETE FROM role_privileges WHERE " "role_id IN (?, ?) AND privilege_id='system:user:list'", - tuple(role_ids(cursor))) + tuple(str(role_id) for role_id in role_ids(cursor))) steps = [ step(add_privilege_to_roles, del_privilege_from_roles) -- cgit v1.2.3