feat(database): show table grants in the Modify Table dialog (#5965)

The Modify Table dialog gains a read-only Grants tab for PostgreSQL and
MySQL tables: one row per grantee and grantor, a column per privilege,
and a `*` mark for privileges held WITH GRANT OPTION.

- PostgreSQL expands the table ACL with aclexplode, falling back to the
  owner's implicit privileges when relacl is null; PUBLIC is listed.
- MySQL reads information_schema.table_privileges (no grantor there).
- Other engines show no tab and run no query; grants load only when the
  tab is opened.

Fixes #5832
Цей коміт міститься в:
l0ng-ai authored and GitHub committed 2026-11-26 04:37:53 +08:00
1 джерело de36b46660
коміт a483ea77f4
18 files changed
+574 -107

No files matched your search

+51
Переглянути файл
@@ -995,6 +995,57 @@
text-align: left;
overflow-wrap: anywhere;
}
.grantsPanel {
flex: 1;
display: flex;
flex-direction: column;
gap: var(--space-2);
min-height: 0;
}
.grantsScroll {
flex: 1;
min-height: 0;
overflow: auto;
border: 1px solid var(--border);
border-radius: var(--radius-small);
}
.grantsTable {
border-collapse: collapse;
min-width: 100%;
white-space: nowrap;
}
.grantsTable th {
position: sticky;
top: 0;
padding: 4px 8px;
text-align: left;
font-weight: 500;
color: var(--fg-muted);
background: var(--bg-dialog);
border-bottom: 1px solid var(--border);
}
.grantsTable td {
height: 24px;
padding: 0 8px;
}
.grantsTable tbody tr:hover {
background: var(--bg-hover);
}
.grantsTable .grantsFlag {
text-align: center;
}
.grantsNone {
color: var(--fg-muted);
}
.grantsMark {
display: inline-flex;
align-items: center;
vertical-align: middle;
}
.grantsOption {
font-weight: 600;
color: var(--accent);
}
.quickDoc {
width: 460px;
max-width: calc(100vw - 32px);