Repository navigation
Description
Problem
Database > Users & Roles lists accounts, edits their privileges as a tree and stages CREATE, ALTER, GRANT, REVOKE and DROP statements for review. It is available on MySQL, MariaDB, PostgreSQL and PGlite only, and dimmed everywhere else (features/users-roles.mdx:8). A driver opts in by implementing PluginPrincipalManagement (apple/Plugins/TableProPluginKit/PluginPrincipalManagement.swift); the SQL Server and Oracle plugins do not.
On those two engines, checking what a login can do, or granting a role, means writing catalog queries and GRANT statements by hand.
Proposed solution
- SQL Server: server logins from
sys.server_principalsand database users and roles fromsys.database_principals, with the mapping between a login and its user in each database. Privileges fromsys.server_permissionsandsys.database_permissionsat server, database, schema and object scope. Role membership throughALTER ROLE ... ADD MEMBERandALTER SERVER ROLE. Create, disable and drop logins and users, set a password, set the default database and schema. - Oracle: users and roles from
DBA_USERSandDBA_ROLES, falling back to theALL_andUSER_views when the account cannot readDBA_. System privileges fromDBA_SYS_PRIVS, object privileges fromDBA_TAB_PRIVS, and granted roles fromDBA_ROLE_PRIVS, includingWITH ADMIN OPTIONandWITH GRANT OPTION. Create, lock, unlock and drop users, set a password, set the default tablespace and quota. - The same review and apply flow as today: statements staged, previewed and applied under Safe Mode, and SQL Server's statements run in one transaction where the server allows it.
Done when: on SQL Server 2019 and Oracle 19c, an account's effective privileges match what the server reports, and creating a user, granting a role and revoking it round-trip.
Alternatives considered
Query the catalog views and write GRANT and REVOKE in a query tab.
Platform
macOS
Related database type
N/A / General
Activity