Skip to content

armgit / Pulse

Public Imported from GitHub
0

Real-time monitoring dashboard for Proxmox VE, PBS, Docker, Kubernetes, TrueNAS and vSphere. Self-hosted, with alerts for failed backups, full disks, unhealthy containers and offline nodes.

Keep saved role permissions visible outside the shortcut list

pulse-triage[bot]0764d667211f
diff --git a/docs/release-control/v6/internal/subsystems/organization-settings.md b/docs/release-control/v6/internal/subsystems/organization-settings.md
index fe8c33c02a..59ee91c176 100644
--- a/docs/release-control/v6/internal/subsystems/organization-settings.md
+++ b/docs/release-control/v6/internal/subsystems/organization-settings.md
@@ -33,7 +33,8 @@ not an empty role list, and its inline Retry performs only a read. Built-in and
obsolete row objects remain uneditable. Save and delete are serialised; deletion
requires the current in-page confirmation, which is withdrawn on context loss.
A failed save preserves the live draft with fixed inline feedback. Closing an
-editor erases its draft. Success feedback belongs to this panel rather than a
+editor erases its draft. Saved permission strings outside the editor's shortcut
+list remain visible and unchanged unless explicitly edited. Success feedback belongs to this panel rather than a
global identity-bearing notification. Backend authorisation, endpoints and
permission semantics remain unchanged.
diff --git a/frontend-modern/src/components/Settings/RolesEditorDialog.tsx b/frontend-modern/src/components/Settings/RolesEditorDialog.tsx
index ff5b4ec05e..dff2b340cd 100644
--- a/frontend-modern/src/components/Settings/RolesEditorDialog.tsx
+++ b/frontend-modern/src/components/Settings/RolesEditorDialog.tsx
@@ -129,6 +129,13 @@ export const RolesEditorDialog: Component<RolesEditorDialogProps> = (props) => (
}
selectBaseClass="w-full sm:flex-1 rounded-md border border-border bg-surface px-2 py-1.5 text-sm text-base-content"
>
+ <Show
+ when={
+ !RBAC_PERMISSION_ACTIONS.some((action) => action === permission.action)
+ }
+ >
+ <option value={permission.action}>{permission.action}</option>
+ </Show>
<For each={RBAC_PERMISSION_ACTIONS}>
{(action) => <option value={action}>{action}</option>}
</For>
@@ -144,6 +151,15 @@ export const RolesEditorDialog: Component<RolesEditorDialogProps> = (props) => (
}
selectBaseClass="w-full sm:flex-1 rounded-md border bg-surface px-2 py-1.5 text-sm text-base-content"
>
+ <Show
+ when={
+ !RBAC_PERMISSION_RESOURCES.some(
+ (resource) => resource === permission.resource,
+ )
+ }
+ >
+ <option value={permission.resource}>{permission.resource}</option>
+ </Show>
<For each={RBAC_PERMISSION_RESOURCES}>
{(resource) => <option value={resource}>{resource}</option>}
</For>
diff --git a/frontend-modern/src/components/Settings/__tests__/RolesReaderLifetime.test.tsx b/frontend-modern/src/components/Settings/__tests__/RolesReaderLifetime.test.tsx
index 8fcb2e4cce..f6fd52a4ca 100644
--- a/frontend-modern/src/components/Settings/__tests__/RolesReaderLifetime.test.tsx
+++ b/frontend-modern/src/components/Settings/__tests__/RolesReaderLifetime.test.tsx
@@ -348,6 +348,22 @@ describe('Roles reader lifetime', () => {
expect(mocks.error).not.toHaveBeenCalled();
});
+ it('keeps unlisted saved permission strings visible and unchanged in the real editor', async () => {
+ mocks.getRoles.mockResolvedValueOnce([
+ { ...north, permissions: [{ action: 'future:read', resource: 'future/*' }] },
+ ]);
+ render(() => <RolesPanel currentUser="reader-a" canManage={true} />);
+ fireEvent.click(await screen.findByRole('button', { name: 'Edit role' }));
+ const dialog = await screen.findByRole('dialog', { name: 'Edit role' });
+ expect(within(dialog).getByLabelText('Permission 1 action')).toHaveValue('future:read');
+ expect(within(dialog).getByLabelText('Permission 1 resource')).toHaveValue('future/*');
+ fireEvent.click(within(dialog).getByRole('button', { name: 'Update Role' }));
+ await waitFor(() => expect(mocks.saveRole).toHaveBeenCalled());
+ expect(mocks.saveRole.mock.calls[0][0].permissions).toEqual([
+ { action: 'future:read', resource: 'future/*' },
+ ]);
+ });
+
it('shows inline draft errors and a cancellable, withdrawable confirmation in the consuming panel', async () => {
const [allowed, setAllowed] = createSignal(true);
mocks.saveRole.mockRejectedValueOnce(new Error('PRIVATE DETAIL'));