diff options
author | Frederick Muriuki Muriithi | 2024-06-07 11:44:37 -0500 |
---|---|---|
committer | Frederick Muriuki Muriithi | 2024-06-07 11:53:26 -0500 |
commit | 50e458b8951f036c487d7854ebe438e4dfbd6c4f (patch) | |
tree | ed0c026a19a9c7d8f3936769509d12347ed76402 /scripts | |
parent | bd56f2cdaef1716cf5207911f9facbe80733519c (diff) | |
download | gn-auth-50e458b8951f036c487d7854ebe438e4dfbd6c4f.tar.gz |
Update role assignment: user resource_roles table
We no longer use the group_roles table, and have moved to the less
privilege-escalation-prone resource_roles table. This commit updates
the queries to use the newer resource_roles table.
Diffstat (limited to 'scripts')
-rw-r--r-- | scripts/migrate_existing_data.py | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/scripts/migrate_existing_data.py b/scripts/migrate_existing_data.py index 1b44666..336ce72 100644 --- a/scripts/migrate_existing_data.py +++ b/scripts/migrate_existing_data.py @@ -383,15 +383,13 @@ def entry(authdbpath, mysqldburi): biodb.database_connection(mysqldburi) as bioconn): admin = select_sys_admin(sys_admins(authconn)) the_admin_group = admin_group(authconn, admin) - resources = default_resources( - authconn, the_admin_group) + resources = default_resources(authconn, the_admin_group) add_resources_to_group(authconn, resources, the_admin_group) for resource in resources: assign_data_to_resource( authconn, bioconn, resource, the_admin_group) with authdb.cursor(authconn) as cursor: - __assign_resource_owner_role__( - cursor, resource, admin, the_admin_group) + __assign_resource_owner_role__(cursor, resource, admin) except DataNotFound as dnf: print(dnf.args[0], file=sys.stderr) sys.exit(1) |