Skip to content

Commit

Permalink
Add select priv to sequences
Browse files Browse the repository at this point in the history
  • Loading branch information
stuartmcalpine committed Sep 19, 2024
1 parent 131a55b commit df9625d
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions scripts/create_registry_schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -399,6 +399,11 @@ def _BuildTable(schema, table_name, has_production, production):
select_prv = f"GRANT {privs} ON ALL TABLES IN SCHEMA {schema} to {acct}"
conn.execute(text(usage_prv))
conn.execute(text(select_prv))

# Need select access to sequences to create entries
if (acct == "reg_writer" and schema != prod_schema) or args.no_permission_restrictions:
privs = f"GRANT USAGE, SELECT ON ALL SEQUENCES IN SCHEMA {schema} TO {acct};"
conn.execute(text(privs))
conn.commit()
except Exception:
print(f"Could not grant access to {acct} on schema {schema}")
Expand Down

0 comments on commit df9625d

Please sign in to comment.