Skip to content

feat: manage schema object permissions #2398

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 10 commits into from
Jun 18, 2025
Merged

feat: manage schema object permissions #2398

merged 10 commits into from
Jun 18, 2025

Conversation

Raubzeug
Copy link
Contributor

@Raubzeug Raubzeug commented Jun 11, 2025

Stand
closes #2353

CI Results

Test Status: βœ… PASSED

πŸ“Š Full Report

Total Passed Failed Flaky Skipped
2 2 0 0 0
Test Changes Summary ✨1 πŸ—‘οΈ163

✨ New Tests (1)

  1. Can grant full access to a new subject (tenant/diagnostics/tabs/access.test.ts)

πŸ—‘οΈ Deleted Tests (163)

  1. Test internalViewer header link (internalViewer/internalViewer.test.ts)
  2. Memory viewer is visible and has correct status (memoryViewer/memoryViewer.test.ts)
  3. Memory viewer shows correct base metrics (memoryViewer/memoryViewer.test.ts)
  4. Memory viewer popup shows on hover with all metrics (memoryViewer/memoryViewer.test.ts)
  5. Nodes page is OK (nodes/nodes.test.ts)
  6. Nodes page has nodes table (nodes/nodes.test.ts)
  7. Table loads and displays data (nodes/nodes.test.ts)
  8. Search by hostname filters the table (nodes/nodes.test.ts)
  9. Table groups displayed correctly if group by option is selected (nodes/nodes.test.ts)
  10. Node count is displayed correctly (nodes/nodes.test.ts)
  11. Uptime values are displayed in correct format (nodes/nodes.test.ts)
  12. Refresh button updates the table data (nodes/nodes.test.ts)
  13. Row data can be retrieved correctly (nodes/nodes.test.ts)
  14. Column values can be retrieved correctly (nodes/nodes.test.ts)
  15. Table displays empty data message when no entities (nodes/nodes.test.ts)
  16. Autorefresh updates data when initially empty data (nodes/nodes.test.ts)
  17. loads data in chunks when scrolling (paginatedTable/paginatedTable.test.ts)
  18. loads data when scrolling to middle of table (paginatedTable/paginatedTable.test.ts)
  19. displays empty state when no data is present (paginatedTable/paginatedTable.test.ts)
  20. handles 10 pages of data correctly (paginatedTable/paginatedTable.test.ts)
  21. handles 100 pages of data correctly (paginatedTable/paginatedTable.test.ts)
  22. Sidebar is visible and loads correctly (sidebar/sidebar.test.ts)
  23. Logo button is visible and clickable (sidebar/sidebar.test.ts)
  24. Settings button is visible and clickable (sidebar/sidebar.test.ts)
  25. Settings button click opens drawer with correct sections (sidebar/sidebar.test.ts)
  26. Information button is visible and clickable (sidebar/sidebar.test.ts)
  27. Information popup contains documentation and keyboard shortcuts (sidebar/sidebar.test.ts)
  28. Clicking hotkeys button in information popup opens hotkeys panel with title (sidebar/sidebar.test.ts)
  29. Account button is visible and clickable (sidebar/sidebar.test.ts)
  30. Pressing Ctrl+K in editor page opens hotkeys panel (sidebar/sidebar.test.ts)
  31. Sidebar can be collapsed and expanded (sidebar/sidebar.test.ts)
  32. Footer items are visible (sidebar/sidebar.test.ts)
  33. Can toggle experiments in settings (sidebar/sidebar.test.ts)
  34. Storage page is OK (storage/storage.test.ts)
  35. Storage page has groups table (storage/storage.test.ts)
  36. Storage page has nodes table (storage/storage.test.ts)
  37. Table loads and displays data (storage/storage.test.ts)
  38. Search by pool name filters the table (storage/storage.test.ts)
  39. Radio button selection changes displayed data (storage/storage.test.ts)
  40. Groups count is displayed correctly (storage/storage.test.ts)
  41. Row data can be retrieved correctly (storage/storage.test.ts)
  42. Column values can be retrieved correctly (storage/storage.test.ts)
  43. Clicking on Group ID header sorts the table (storage/storage.test.ts)
  44. Info tab shows main page elements (tenant/diagnostics/tabs/info.test.ts)
  45. Info tab shows resource utilization (tenant/diagnostics/tabs/info.test.ts)
  46. Info tab shows healthcheck status (tenant/diagnostics/tabs/info.test.ts)
  47. Nodes tab shows nodes table with memory viewer (tenant/diagnostics/tabs/nodes.test.ts)
  48. No runnning queries in Queries if no queries are running (tenant/diagnostics/tabs/queries.test.ts)
  49. Running query is shown if query is running (tenant/diagnostics/tabs/queries.test.ts)
  50. Query tab defaults to Top mode (tenant/diagnostics/tabs/queries.test.ts)
  51. Query Top tab shows expected column headers (tenant/diagnostics/tabs/queries.test.ts)
  52. Query tab first row has values for all columns in Top mode (tenant/diagnostics/tabs/queries.test.ts)
  53. Query tab can switch between Top and Running modes (tenant/diagnostics/tabs/queries.test.ts)
  54. Query tab allows changing between Per hour and Per minute views (tenant/diagnostics/tabs/queries.test.ts)
  55. Top Query rows components have consistent height across different query lengths (tenant/diagnostics/tabs/queries.test.ts)
  56. Scroll to row, get shareable link, navigate to URL and verify row is scrolled into view (tenant/diagnostics/tabs/queries.test.ts)
  57. Primary keys header is visible in Schema tab (tenant/diagnostics/tabs/schema.test.ts)
  58. Storage tab shows Groups and Nodes views (tenant/diagnostics/tabs/storage.test.ts)
  59. TopShards tab defaults to Immediate mode (tenant/diagnostics/tabs/topShards.test.ts)
  60. TopShards immediate tab shows all expected column headers (tenant/diagnostics/tabs/topShards.test.ts)
  61. TopShards history tab shows all expected column headers (tenant/diagnostics/tabs/topShards.test.ts)
  62. TopShards tab first row has values for all columns in Immediate mode (tenant/diagnostics/tabs/topShards.test.ts)
  63. TopShards tab first row has values for all columns in History mode (tenant/diagnostics/tabs/topShards.test.ts)
  64. TopShards tab can switch back to Immediate mode from Historical mode (tenant/diagnostics/tabs/topShards.test.ts)
  65. Tenant diagnostics page is visible (tenant/initialLoad.test.ts)
  66. Tenant diagnostics page is visible when describe returns no data (tenant/initialLoad.test.ts)
  67. Tenant page shows error message when describe returns 401 (tenant/initialLoad.test.ts)
  68. Tenant page shows error message when describe returns 403 (tenant/initialLoad.test.ts)
  69. Plan to SVG dropdown shows options and opens plan in new tab (tenant/queryEditor/planToSvg.test.ts)
  70. Plan to SVG download option triggers file download (tenant/queryEditor/planToSvg.test.ts)
  71. Plan to SVG handles API errors correctly (tenant/queryEditor/planToSvg.test.ts)
  72. Statistics setting becomes disabled when execution plan experiment is enabled (tenant/queryEditor/planToSvg.test.ts)
  73. Statistics mode changes when toggling execution plan experiment (tenant/queryEditor/planToSvg.test.ts)
  74. Statistics setting shows tooltip when disabled by execution plan experiment (tenant/queryEditor/planToSvg.test.ts)
  75. Run button executes YQL script (tenant/queryEditor/queryEditor.test.ts)
  76. Run button executes Scan (tenant/queryEditor/queryEditor.test.ts)
  77. Explain button executes YQL script explanation (tenant/queryEditor/queryEditor.test.ts)
  78. Explain button executes Scan explanation (tenant/queryEditor/queryEditor.test.ts)
  79. Error is displayed for invalid query for run (tenant/queryEditor/queryEditor.test.ts)
  80. Error is displayed for invalid query for explain (tenant/queryEditor/queryEditor.test.ts)
  81. Run and Explain buttons are disabled when query is empty (tenant/queryEditor/queryEditor.test.ts)
  82. Stop button and elapsed time label appear when query is running (tenant/queryEditor/queryEditor.test.ts)
  83. Query streaming finishes in reasonable time (tenant/queryEditor/queryEditor.test.ts)
  84. Query execution is terminated when stop button is clicked (tenant/queryEditor/queryEditor.test.ts)
  85. Streaming query shows some results and banner when stop button is clicked (tenant/queryEditor/queryEditor.test.ts)
  86. Stop button is not visible for quick queries (tenant/queryEditor/queryEditor.test.ts)
  87. Stop button works for Execute mode (tenant/queryEditor/queryEditor.test.ts)
  88. Stop button works for Explain mode (tenant/queryEditor/queryEditor.test.ts)
  89. Changing tab inside results pane doesnt change results view (tenant/queryEditor/queryEditor.test.ts)
  90. Changing tab inside editor doesnt change results view (tenant/queryEditor/queryEditor.test.ts)
  91. Changing tab to diagnostics doesnt change results view (tenant/queryEditor/queryEditor.test.ts)
  92. Result head value is 1 for 1 row result (tenant/queryEditor/queryEditor.test.ts)
  93. No result head value for no result (tenant/queryEditor/queryEditor.test.ts)
  94. Truncated head value is 1 for 1 row truncated result (tenant/queryEditor/queryEditor.test.ts)
  95. Truncated results for multiple tabs (tenant/queryEditor/queryEditor.test.ts)
  96. Query execution status changes correctly (tenant/queryEditor/queryEditor.test.ts)
  97. Running selected query via keyboard shortcut executes only selected part (tenant/queryEditor/queryEditor.test.ts)
  98. Running selected query via context menu executes only selected part (tenant/queryEditor/queryEditor.test.ts)
  99. Results controls collapse and expand functionality (tenant/queryEditor/queryEditor.test.ts)
  100. Copy result button copies to clipboard (tenant/queryEditor/queryEditor.test.ts)
  101. Stats tab shows no stats message when STATISTICS_MODES.none (tenant/queryEditor/queryEditor.test.ts)
  102. Stats tab shows JSON viewer when STATISTICS_MODES.basic (tenant/queryEditor/queryEditor.test.ts)
  103. Settings dialog opens on Gear click and closes on Cancel (tenant/queryEditor/querySettings.test.ts)
  104. Settings dialog saves changes and updates Gear button (tenant/queryEditor/querySettings.test.ts)
  105. Banner appears after executing script with changed settings (tenant/queryEditor/querySettings.test.ts)
  106. Banner not appears for running query (tenant/queryEditor/querySettings.test.ts)
  107. Gear button shows number of changed settings (tenant/queryEditor/querySettings.test.ts)
  108. Banner does not appear when executing script with default settings (tenant/queryEditor/querySettings.test.ts)
  109. Shows error for limit rows > 100000 (tenant/queryEditor/querySettings.test.ts)
  110. Shows error for negative limit rows (tenant/queryEditor/querySettings.test.ts)
  111. Persists valid limit rows value (tenant/queryEditor/querySettings.test.ts)
  112. Allows empty limit rows value (tenant/queryEditor/querySettings.test.ts)
  113. Timeout input is invisible by default (tenant/queryEditor/querySettings.test.ts)
  114. Clicking timeout switch makes timeout input visible (tenant/queryEditor/querySettings.test.ts)
  115. Timeout switch is checked, disabled, and has hint when non-query mode is selected (tenant/queryEditor/querySettings.test.ts)
  116. When Query Streaming is off, timeout has label and input is visible by default (tenant/queryEditor/querySettings.test.ts)
  117. No query status when no query was executed (tenant/queryEditor/queryStatus.test.ts)
  118. Running query status for running query (tenant/queryEditor/queryStatus.test.ts)
  119. Completed query status for completed query (tenant/queryEditor/queryStatus.test.ts)
  120. Failed query status for failed query (tenant/queryEditor/queryStatus.test.ts)
  121. Update table template should not run successfully (tenant/queryEditor/queryTemplates.test.ts)
  122. Create row table template should handle both success and failure cases (tenant/queryEditor/queryTemplates.test.ts)
  123. Unsaved changes modal appears when switching between templates if query was edited (tenant/queryEditor/queryTemplates.test.ts)
  124. Cancel button in unsaved changes modal preserves editor content (tenant/queryEditor/queryTemplates.test.ts)
  125. Dont save button in unsaved changes modal allows to change text (tenant/queryEditor/queryTemplates.test.ts)
  126. Save query flow saves query and shows it in Saved tab (tenant/queryEditor/queryTemplates.test.ts)
  127. New SQL dropdown menu works correctly (tenant/queryEditor/queryTemplates.test.ts)
  128. Template selection shows unsaved changes warning when editor has content (tenant/queryEditor/queryTemplates.test.ts)
  129. Switching between templates does not trigger unsaved changes modal (tenant/queryEditor/queryTemplates.test.ts)
  130. Selecting a template and then opening history query does not trigger unsaved changes modal (tenant/queryEditor/queryTemplates.test.ts)
  131. New query appears in history after execution (tenant/queryHistory/queryHistory.test.ts)
  132. Multiple queries appear in correct order in history (tenant/queryHistory/queryHistory.test.ts)
  133. Query executed with keybinding is saved in history (tenant/queryHistory/queryHistory.test.ts)
  134. Can run query from history (tenant/queryHistory/queryHistory.test.ts)
  135. Can search in query history (tenant/queryHistory/queryHistory.test.ts)
  136. No unsaved changes modal when running a query and selecting from history (tenant/queryHistory/queryHistory.test.ts)
  137. No unsaved changes modal when running a query that is identical to last in history (tenant/queryHistory/queryHistory.test.ts)
  138. Unsaved changes modal appears when modifying a query and selecting from history (tenant/queryHistory/queryHistory.test.ts)
  139. No unsaved changes modal when selecting from history after saving a query (tenant/queryHistory/queryHistory.test.ts)
  140. View list of saved queries (tenant/savedQueries/savedQueries.test.ts)
  141. Open saved query in the Editor (tenant/savedQueries/savedQueries.test.ts)
  142. Save a query from the Editor (tenant/savedQueries/savedQueries.test.ts)
  143. No unsaved changes modal when opening another query after saving (tenant/savedQueries/savedQueries.test.ts)
  144. Unsaved changes modal appears when selecting a saved query after modifications (tenant/savedQueries/savedQueries.test.ts)
  145. No unsaved changes modal when switching from saved query to another query (tenant/savedQueries/savedQueries.test.ts)
  146. Open Preview icon appears on hover for "dv_slots" tree item (tenant/summary/objectSummary.test.ts)
  147. On Open Preview icon click table with results appear (tenant/summary/objectSummary.test.ts)
  148. Preview table is still present after settings dialog was opened (tenant/summary/objectSummary.test.ts)
  149. Primary keys header is visible in Schema tab (tenant/summary/objectSummary.test.ts)
  150. Actions dropdown menu opens and contains expected items (tenant/summary/objectSummary.test.ts)
  151. Can click menu items in actions dropdown (tenant/summary/objectSummary.test.ts)
  152. Select and Upsert actions show loading state (tenant/summary/objectSummary.test.ts)
  153. Monaco editor shows column list after select query loading completes (tenant/summary/objectSummary.test.ts)
  154. Monaco editor shows column list after upsert query loading completes (tenant/summary/objectSummary.test.ts)
  155. Different tables show different column lists in Monaco editor (tenant/summary/objectSummary.test.ts)
  156. ACL tab shows correct access rights (tenant/summary/objectSummary.test.ts)
  157. Copy path copies correct path to clipboard (tenant/summary/objectSummary.test.ts)
  158. Create directory in local node (tenant/summary/objectSummary.test.ts)
  159. Refresh button updates tree view after creating table (tenant/summary/objectSummary.test.ts)
  160. Info panel collapse and expand functionality (tenant/summary/objectSummary.test.ts)
  161. Summary collapse and expand functionality (tenant/summary/objectSummary.test.ts)
  162. Tenants page is OK (tenants/tenants.test.ts)
  163. Tenants page has tenants table (tenants/tenants.test.ts)

Bundle Size: πŸ”Ί

Current: 83.90 MB | Main: 83.77 MB
Diff: +0.13 MB (0.15%)

⚠️ Bundle size increased. Please review.

ℹ️ CI Information
  • Test recordings for failed tests are available in the full report.
  • Bundle size is measured for the entire 'dist' directory.
  • πŸ“Š indicates links to detailed reports.
  • πŸ”Ί indicates increase, πŸ”½ decrease, and βœ… no change in bundle size.

@Raubzeug Raubzeug changed the title Access rights feat: manage schema object permissions Jun 11, 2025

const {handleShowGrantAccessChange} = useTenantQueryParams();

const loading = isFetching && !currentData;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why cant isLoading be used here?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it seems we can

<Dialog open={open} size="s" onClose={onClose}>
<Dialog.Header caption={i18n('action_change-owner')} />
<form
onSubmit={(e) => {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AFAIK We use react-hook-form for forms in this project

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

actually, no need in form here

return (
<Dialog open={open} size="s" onClose={onClose}>
<Dialog.Header caption={i18n('label_revoke-all-rights')} />
<form
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do we need form here?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No need indeed


export const block = cn('ydb-grant-access');

export const HumanReadableRights: Record<string, number> = {
Copy link
Collaborator

@astandrik astandrik Jun 16, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

RightsCodes ? or AccessRights. Dont think numbers are human-readable

@astandrik astandrik requested a review from Copilot June 16, 2025 15:30
Copilot

This comment was marked as outdated.

@Raubzeug Raubzeug requested a review from astandrik June 17, 2025 13:39

const VIEW_PAGES = [overview, schema, describe];
const VIEW_PAGES = [overview, schema, describe, access];
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe we could like

const COMMON_PAGES = [overview, access,....]

and then

const TABLE_PAGES = [...COMMON_PAGES, someOtherPage]

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems no use... only overview is always first page. Others are mixed for different views.

// if (subjectText.includes(searchText)) {
// return true;
// }
// }
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Commented code

// }

// return false;
// }
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

commented code

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

omg, sorry

@astandrik astandrik requested a review from Copilot June 18, 2025 11:57
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR introduces a new diagnostics-based UI for managing schema object permissions, including granting, revoking, and changing ownership, while deprecating the legacy Acl panel.

  • Added a dedicated GrantAccess drawer for selecting subjects and updating rights.
  • Created an AccessRights diagnostics tab with owner card, rights table, and dialogs for revoke-all and change-owner.
  • Removed the legacy Acl component and updated navigation to point to the new diagnostics access tab.

Reviewed Changes

Copilot reviewed 52 out of 52 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
src/containers/Tenant/GrantAccess/GrantAccess.tsx New drawer component to grant/revoke permissions
src/containers/Tenant/GrantAccess/GrantAccess.scss Styles for the GrantAccess drawer
src/containers/Tenant/Diagnostics/DiagnosticsPages.ts Registered new access tab in diagnostics page mappings
src/containers/Tenant/Diagnostics/Diagnostics.tsx Render AccessRights component in diagnostics when tab=access
src/containers/Tenant/Diagnostics/AccessRights/shared.ts BEM block helper for AccessRights
src/containers/Tenant/Diagnostics/AccessRights/i18n/index.ts i18n keyset registration for AccessRights
src/containers/Tenant/Diagnostics/AccessRights/i18n/en.json Locale strings for AccessRights
src/containers/Tenant/Diagnostics/AccessRights/components/RightsTable/columns.tsx Defines columns for explicit/effective rights table
src/containers/Tenant/Diagnostics/AccessRights/components/RightsTable/RightsTable.tsx Data-table wrapper component for rights
src/containers/Tenant/Diagnostics/AccessRights/components/RightsTable/RevokeAllRightsDialog.tsx Modal dialog for revoking all rights
src/containers/Tenant/Diagnostics/AccessRights/components/RightsTable/Actions.tsx Actions (grant/revoke) buttons for each subject
src/containers/Tenant/Diagnostics/AccessRights/components/Owner.tsx Owner card with change-owner action
src/containers/Tenant/Diagnostics/AccessRights/components/ChangeOwnerDialog.tsx Modal dialog for changing object owner
src/containers/Tenant/Diagnostics/AccessRights/AccessRights.tsx Top-level AccessRights page (error/loading/data)
src/containers/Tenant/Diagnostics/AccessRights/AccessRights.scss Styles for AccessRights page
src/containers/Tenant/Acl/i18n/en.json Removed legacy ACL keys, added navigation-to-diagnostics
src/containers/Tenant/Acl/Acl.tsx Deprecated ACL panel, now links to diagnostics
src/containers/Tenant/Acl/Acl.scss Removed legacy ACL styles
src/components/SubjectWithAvatar/SubjectWithAvatar.tsx Avatar+text component for subjects
src/components/SubjectWithAvatar/SubjectWithAvatar.scss Styles for SubjectWithAvatar

"label_explicit-rights": "Explicit rights",
"label_effective-rights": "Effective rights",
"label_subject": "Subject",
"descrtiption_empty-rights": "No access rights",
Copy link
Preview

Copilot AI Jun 18, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Typo in key name: 'descrtiption_empty-rights' should be 'description_empty-rights'.

Suggested change
"descrtiption_empty-rights": "No access rights",
"description_empty-rights": "No access rights",

Copilot uses AI. Check for mistakes.

"label_effective-rights": "Effective rights",
"label_subject": "Subject",
"descrtiption_empty-rights": "No access rights",
"decription_enter-subject": "Enter subject",
Copy link
Preview

Copilot AI Jun 18, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Typo in key name: 'decription_enter-subject' should be 'description_enter-subject'.

Suggested change
"decription_enter-subject": "Enter subject",
"description_enter-subject": "Enter subject",

Copilot uses AI. Check for mistakes.

"description_effective-rights": "Total active permissions from inheritance and direct grants",
"action_revoke": "Revoke",
"label_revoke-all-rights": "Revoke all explicit rights",
"descripition_no-rights-to-revoke": "No rights to revoke",
Copy link
Preview

Copilot AI Jun 18, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Typo in key name: 'descripition_no-rights-to-revoke' should be 'description_no-rights-to-revoke'.

Suggested change
"descripition_no-rights-to-revoke": "No rights to revoke",
"description_no-rights-to-revoke": "No rights to revoke",

Copilot uses AI. Check for mistakes.

@Raubzeug Raubzeug added this pull request to the merge queue Jun 18, 2025
Merged via the queue into main with commit 0c89baa Jun 18, 2025
7 checks passed
@Raubzeug Raubzeug deleted the access-rights branch June 18, 2025 12:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Implement acl management
2 participants