Permission Trace — Database Drilldown
Help ID: guide.permission-trace-drilldown
Double-clicking a server in the Permission Trace view opens the per-database drilldown: one grid showing every effective permission that principal has on that database, grouped by object, source role, and grant chain. The drilldown is a read-only view of the trace — but it is also where the admin reaches for change scripts against the principal's permissions on that single database.
Right-click actions
The drilldown mirrors the Permissions Matrix's right-click vocabulary. Right-clicking any row produces:
- Add to role… — pick a database role; builds
ALTER ROLE [role] ADD MEMBER [principal]. - Drop from role… — pick a role the principal is currently a member of; builds
ALTER ROLE [role] DROP MEMBER [principal]. - GRANT / REVOKE / DENY sub-menus — database-scope permissions (
CONNECT,EXECUTE,VIEW DEFINITION, …) on the containing database; builds the correspondingGRANT/REVOKE/DENYstatement for the row's principal.
Every item routes through PermissionChangeBuilder to produce the Apply and Undo SQL, packages the pair into a ScriptActionPayload, and opens it in the shared Script Action Bar via PermissionsChangePreviewWindow. From there the admin can deploy now, schedule, open in Query Pilot, save to the library, or any of the other Actions dropdown destinations — exactly the same choices the Permissions Matrix and the Consolidator offer.
How the clicked row is captured
Row identity is captured from the grid's CurrentItem in ContextMenu.Opened, before any menu-item command fires, and set on DatabaseDrilldownViewModel.ClickedRow. Commands read ClickedRow rather than re-querying the grid, so right-click → menu-navigate-with-keyboard works even if the row selection changes between menu open and command invocation.
Why the drilldown, not the trace
The top-level Permission Trace view visualises how a principal got a permission (group chain, role chain, direct grant) and intentionally doesn't let the admin act on single rows — a direct grant visible there can be on any of many databases, and acting on it needs the database context. The database drilldown has that context by construction: every row already carries a single (server, database, principal, object/permission) tuple. That is what the Script Action Bar needs for its target chip.
Related: Script Action Bar · Permissions Matrix · Consolidator · Deploys.
Documentation revision: 264E17A80A2099ED