diff --git a/CLAUDE.md b/CLAUDE.md index c1fb7da..70b1ec4 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -52,7 +52,7 @@ Output: `package/target/rbac-1.3.0.zip` - `initialize()` calls `getMyPermissions()` REST endpoint; lazy retry on first `checkTask()` if initial load fails - Fail-closed: if permissions can't be loaded, tasks are denied - Both role editors check a new or changed name or description before saving. If the server would refuse it, they show the server's message and keep the editor open. The Swing `RoleEditorDialog` calls `NameCharacters.editorRefusal` (shared module, the server's own rule); the web editor calls `editorRefusal` in `rbac-core.js`. `NameCharacterCasesTest` and `name-characters.test.mjs` both read `webadmin/web/name-character-cases.txt`, so the two rules give the same answers and show the same messages; `webadmin/e2e/role-editor.spec.js` checks the web editor in CI, and the Swing editor's check has no CI test. Before the check (measured on OIE 4.7.0), the Swing panel showed the engine's general error dialog, with a stack trace starting "400 Bad Request" and without rbac's message, and a bell in a description failed inside the Swing client before reaching rbac. In both editors the editor closed on Apply, and the edits were lost (owner's decision 2026-11-24) -- Export Roles and Import Roles (`settings_Role-Based Access Control/doExportRoles`, `/doImportRoles`) are admin-only tasks, not permissions: `checkTask` answers them from an admin flag loaded with the permissions (only when the user holds View Roles: the current user's id, then `getUserRole`; a failure leaves the flag unknown, which answers not admin, and the next check of an admin-only task retries the lookup at most once per 15 seconds). Gated in the controller, not the panel, because `Frame.setVisibleTasks` re-runs `checkTask` whenever it shows tasks. Web twin: `ADMIN_ONLY_TASKS` in `task-permission-map.js` and `adminOnlyTasks` in `task-permission-map.json` +- Export Roles, Import Roles and Orphaned Permissions (`settings_Role-Based Access Control/doExportRoles`, `/doImportRoles`, `/doShowOrphanedPermissions`) are admin-only tasks, not permissions: `checkTask` answers them from an admin flag loaded with the permissions (only when the user holds View Roles: the current user's id, then `getUserRole`; a failure leaves the flag unknown, which answers not admin, and the next check of an admin-only task retries the lookup at most once per 15 seconds). Gated in the controller, not the panel, because `Frame.setVisibleTasks` re-runs `checkTask` whenever it shows tasks. Web twin: `ADMIN_ONLY_TASKS` in `task-permission-map.js` and `adminOnlyTasks` in `task-permission-map.json` - The export and import flows live in `RoleTransferActions`, `RoleExportDialog`, `RoleImportDialog` and `RoleImportText` (wording, default ticks; web twin in `rbac-core.js`). The file is written as plain UTF-8, never through `Frame.exportFile`, which encrypts when export encryption is on; `RoleImportFile` reads an import file, refusing one over 5 MB or not in UTF-8 before anything is sent ### Database @@ -69,7 +69,8 @@ Output: `package/target/rbac-1.3.0.zip` - Users: GET `/users/{userId}/role`, POST `/users/{userId}/role/{roleId}`, DELETE `/users/{userId}/role` - Permissions: GET `/permissions` (all available), GET `/my-permissions` (current user's granted permissions), GET `/permissions/extensions` (extension permission → publishing plugin, for the role editors' per-plugin headers), GET `/task-permissions` (extension task → permission, whitelisted for all users) - Export/import: GET `/roles/_export?roleId=` (the file, `text/plain`), POST `/roles/_import?dryRun=&applyChannels=&matchChannelsByName=&pick=&planToken=` (the file as a `text/plain` body; preview, then apply the picked roles in one transaction). Format and rules: `docs/role-export-format.md` -- `@MirthOperation` annotations with `PERMISSION_VIEW = "View Roles"` and `PERMISSION_MANAGE = "Manage Roles"`. Export and import are admin-only: their operations are registered under View Roles and Manage Roles (so never unknown), `RbacAuthorizationController` refuses them to anyone without the admin role (`ADMIN_ONLY_OPERATIONS`, so the audit records a FAILURE, not a success), and `RoleTransferService` checks again +- Orphaned permissions: GET `/roles/_unregistered` (the grants no installed plugin registers, never the engine's own, and the names of the disabled plugins), POST `/roles/_unregistered/_remove` (the picked grants, each checked again; one transaction) +- `@MirthOperation` annotations with `PERMISSION_VIEW = "View Roles"` and `PERMISSION_MANAGE = "Manage Roles"`. Export, import and the orphaned-permissions calls are admin-only: their operations are registered under View Roles and Manage Roles (so never unknown), `RbacAuthorizationController` refuses them to anyone without the admin role (`ADMIN_ONLY_OPERATIONS`, so the audit records a FAILURE, not a success), and `RoleTransferService` checks again ### Role Export and Import - `RoleTransferFormat` writes and strictly reads the file (format 1; DOCTYPE refused; no XStream). Unknown elements, attributes or format versions refuse the whole file, so a newer file is never partly read @@ -97,7 +98,8 @@ Output: `package/target/rbac-1.3.0.zip` - The admin role's retention floor is the **core** permission set, not core+extension. The seeder grants only core perms, and admin access is by the flag regardless of stored perms, so requiring extension perms just made the admin role uneditable. - `manageExtensions` is effectively an admin-equivalent grant: a holder can disable the RBAC extension, and on the next restart the engine reverts to the always-allow `DefaultAuthorizationController` (every user becomes admin). The role editor tags it with a warning tooltip; treat it as a privileged grant. This mirrors stock OIE (manageExtensions = install/enable/disable plugins = arbitrary code). - `Manage Roles` is for delegating user management, not a security boundary: a holder can give their own account any role, the admin role included (measured on OIE 4.7.0 with rbac 1.2.0). Both role editors tag it with a warning tooltip, like `manageExtensions`. -- Role export and import are admin-only, rbac's only operations that are (decided 2026-10-31, before 1.3.0 shipped). Importing is admin-level power anyway (see Manage Roles above), and the admin role sees every channel, so an export can name each one. Separate Export Roles and Import Roles permissions were built first and removed before release; adding a grantable permission later is additive, removing a shipped one is not +- Role export and import are admin-only (decided 2026-10-31, before 1.3.0 shipped). Importing is admin-level power anyway (see Manage Roles above), and the admin role sees every channel, so an export can name each one. Separate Export Roles and Import Roles permissions were built first and removed before release; adding a grantable permission later is additive, removing a shipped one is not +- The Orphaned Permissions list and removal (`UnregisteredGrantService`, `OrphanedPermissionsDialog`, `orphaned-permissions.jsx`) are admin-only too, checked again in the service. They only remove grants; granting a renamed permission's new name stays in the role editor. Engine permissions are never listed or removed. Nothing is listed when rbac can't read the engine's permissions or before the plugins' permissions are registered (rbac's own View Roles missing from the registered set). Removal deletes each picked grant by role and name, in one transaction. Every database's `UNIQUE (role_id, permission)` keeps a role from holding two names that differ only in case, also where the database compares them ignoring case (measured on MySQL 8.4 and SQL Server 2022). The dialog names installed plugins that are disabled: a disabled plugin stays in `getPluginMetaData`, reports disabled, and its permissions leave the catalog (measured on OIE 4.7.0 with Data Pruner). The dialog has no plugin column, because rbac doesn't remember which plugin registered a permission (owner's decisions 2026-11-23 and 2026-11-25) - No role assigned = deny all (server-side), except a user's own account, password and preferences (`isSelfUserOperation`); fail-closed (client-side). A role restricted to no channel (`restricted` true, no rows) sees no channel; the Administrators' role editors allow "Specific Channels" with nothing ticked for exactly that (owner's decision 2026-11-04, replacing the every-channel meaning of an empty list) - Unknown operations = allow (server-side fallback for login, infrastructure); `@DontCheckAuthorized` reads instead return `false` to degrade gracefully (see `DEGRADABLE_OPERATIONS`) - VIEW_SETTINGS intentionally unmapped in client — always shown; individual settings tabs gated by group-specific permissions diff --git a/README.md b/README.md index 97037f6..9a0fe69 100644 --- a/README.md +++ b/README.md @@ -92,7 +92,7 @@ So when the engine or an extension declares a permission, RBAC enforces it with The exception is the engine's user preference calls (each user's Administrator settings), which declare no permission in OIE 4.7.0. RBAC requires Manage Users for another user's preferences and allows every user their own. Once the engine declares a permission on them, RBAC uses that instead. -A role stores a plugin's permission by its display name, the name the role editors show for it, such as "View Server Log" (Server Log), "View Settings" (Data Pruner) or "View Global Maps" (Global Maps). If a new version of the plugin renames the permission, or the plugin is removed, the role keeps the old name, and that grant does nothing. After a rename, the role's users are refused the plugin's operations until an admin grants the new name, and RBAC logs the role and the old name the first time one of its users is refused for a missing permission after the engine starts. The role editors don't show such a grant, and saving the role keeps it, so it comes back into use if the plugin is installed again. Plugin authors: keep a permission's display name the same across versions. +A role stores a plugin's permission by its display name, the name the role editors show for it, such as "View Server Log" (Server Log), "View Settings" (Data Pruner) or "View Global Maps" (Global Maps). If a new version of the plugin renames the permission, or the plugin is removed, the role keeps the old name, and that grant does nothing. After a rename, the role's users are refused the plugin's operations until an admin grants the new name, and RBAC logs the role and the old name the first time one of its users is refused for a missing permission after the engine starts. The role editors don't show such a grant, and saving the role keeps it, so it comes back into use if the plugin is installed again. An admin can list and remove such grants with the Orphaned Permissions task in the RBAC tab; engine permissions are never listed there. Plugin authors: keep a permission's display name the same across versions. The engine's plugin-settings calls (`/api/extensions/{name}/properties`) are allowed only under the exact name of an installed extension, and rbac's own settings only to the admin role. diff --git a/client/src/main/java/com/diridium/rbac/OrphanedPermissionsDialog.java b/client/src/main/java/com/diridium/rbac/OrphanedPermissionsDialog.java new file mode 100644 index 0000000..bc14578 --- /dev/null +++ b/client/src/main/java/com/diridium/rbac/OrphanedPermissionsDialog.java @@ -0,0 +1,253 @@ +// SPDX-FileCopyrightText: Copyright 2025-2026 Diridium Technologies Inc. +// SPDX-License-Identifier: MPL-2.0 + +package com.diridium.rbac; + +import java.awt.BorderLayout; +import java.awt.CardLayout; +import java.awt.Component; +import java.awt.Dimension; +import java.awt.FlowLayout; +import java.util.ArrayList; +import java.util.List; +import java.util.concurrent.Callable; +import java.util.concurrent.ExecutionException; +import java.util.function.Consumer; + +import javax.swing.BorderFactory; +import javax.swing.Box; +import javax.swing.BoxLayout; +import javax.swing.JButton; +import javax.swing.JDialog; +import javax.swing.JLabel; +import javax.swing.JOptionPane; +import javax.swing.JPanel; +import javax.swing.JScrollPane; +import javax.swing.JTable; +import javax.swing.ListSelectionModel; +import javax.swing.SwingWorker; +import javax.swing.table.AbstractTableModel; +import javax.swing.table.TableRowSorter; + +import com.mirth.connect.client.core.ClientException; +import com.mirth.connect.client.ui.Frame; + +/** + * The admin-only Orphaned Permissions dialog: the permissions roles hold that neither the engine nor any installed + * plugin registers, with Remove Selected and Remove All. The server lists them, never the engine's own permissions, + * and checks each removal again. Web twin: orphaned-permissions.jsx, with the same texts in rbac-core.js. + */ +public class OrphanedPermissionsDialog extends JDialog { + + static final String TITLE = "Orphaned Permissions"; + static final String TOOLTIP = "Remove orphaned permissions."; + static final String INTRO = "These permissions are orphaned, usually because a plugin changed or was removed. " + + "Engine permissions are never listed here."; + static final String EMPTY = "No role holds an orphaned permission."; + + /** The line naming the disabled plugins, or {@code null} when none is disabled. */ + static String disabledLine(List plugins) { + return plugins == null || plugins.isEmpty() ? null + : "Disabled plugins: " + String.join(", ", plugins) + ". Their permissions may appear in this list."; + } + + /** "Remove 3 orphaned permissions from 2 roles?", with the singular for one. */ + static String confirmation(List grants) { + long roles = grants.stream().map(UnregisteredGrant::getRoleId).distinct().count(); + return "Remove " + grants.size() + " orphaned permission" + (grants.size() == 1 ? "" : "s") + " from " + roles + + " role" + (roles == 1 ? "" : "s") + "?"; + } + + private final Frame parent; + private final Runnable refreshPanel; + private final GrantModel model = new GrantModel(); + private final JTable table = new JTable(model); + private final JLabel disabled = new JLabel(); + private final CardLayout cards = new CardLayout(); + private final JPanel center = new JPanel(cards); + private final JButton removeSelected = new JButton("Remove Selected"); + private final JButton removeAll = new JButton("Remove All"); + private boolean removing; + + /** Loads the list, then shows the dialog. A failed load is reported and no dialog opens. */ + static void open(Frame parent, Runnable refreshPanel) { + background(parent, parent, () -> rbac(parent).getUnregisteredGrants(), + grants -> new OrphanedPermissionsDialog(parent, refreshPanel, grants).setVisible(true), null); + } + + private OrphanedPermissionsDialog(Frame parent, Runnable refreshPanel, UnregisteredGrants grants) { + super(parent, TITLE, true); + this.parent = parent; + this.refreshPanel = refreshPanel; + + table.setAutoResizeMode(JTable.AUTO_RESIZE_ALL_COLUMNS); + table.setDefaultRenderer(Object.class, new PlainCellRenderer(null)); + table.setRowSorter(new TableRowSorter<>(model)); + table.setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION); + table.getSelectionModel().addListSelectionListener(e -> updateButtons()); + JScrollPane scroll = new JScrollPane(table); + scroll.setPreferredSize(new Dimension(700, 300)); + JLabel empty = new JLabel(EMPTY); + empty.setVerticalAlignment(JLabel.TOP); + center.add(scroll, "table"); + center.add(empty, "empty"); + center.setBorder(BorderFactory.createEmptyBorder(0, 8, 0, 8)); + + JLabel intro = new JLabel(INTRO); + JPanel top = new JPanel(); + top.setLayout(new BoxLayout(top, BoxLayout.Y_AXIS)); + top.setBorder(BorderFactory.createEmptyBorder(8, 8, 8, 8)); + intro.setAlignmentX(Component.LEFT_ALIGNMENT); + disabled.setAlignmentX(Component.LEFT_ALIGNMENT); + top.add(intro); + top.add(Box.createVerticalStrut(6)); + top.add(disabled); + + removeSelected.addActionListener(e -> remove(selectedGrants())); + removeAll.addActionListener(e -> remove(model.all())); + JButton close = new JButton("Close"); + close.addActionListener(e -> dispose()); + JPanel buttons = new JPanel(new FlowLayout(FlowLayout.RIGHT)); + buttons.add(removeSelected); + buttons.add(removeAll); + buttons.add(close); + + add(top, BorderLayout.NORTH); + add(center, BorderLayout.CENTER); + add(buttons, BorderLayout.SOUTH); + show(grants); + setResizable(true); + pack(); + setMinimumSize(new Dimension(640, 420)); + setLocationRelativeTo(parent); + } + + private void show(UnregisteredGrants grants) { + model.set(grants.getGrants()); + String line = disabledLine(grants.getDisabledPlugins()); + disabled.setText(line == null ? "" : line); + disabled.setVisible(line != null); + cards.show(center, model.getRowCount() == 0 ? "empty" : "table"); + updateButtons(); + } + + private void updateButtons() { + removeSelected.setEnabled(!removing && table.getSelectedRowCount() > 0); + removeAll.setEnabled(!removing && model.getRowCount() > 0); + } + + private List selectedGrants() { + List selected = new ArrayList<>(); + for (int view : table.getSelectedRows()) { + selected.add(model.get(table.convertRowIndexToModel(view))); + } + return selected; + } + + private void remove(List grants) { + if (grants.isEmpty() || JOptionPane.showConfirmDialog(this, confirmation(grants), TITLE, + JOptionPane.YES_NO_OPTION) != JOptionPane.YES_OPTION) { + return; + } + UnregisteredGrants request = new UnregisteredGrants(); + request.setGrants(new ArrayList<>(grants)); + removing = true; + updateButtons(); + // The buttons come back once the list has reloaded, or when either call fails. + background(parent, this, () -> rbac(parent).removeUnregisteredGrants(request), removed -> { + refreshPanel.run(); + background(parent, this, () -> rbac(parent).getUnregisteredGrants(), reloaded -> { + removing = false; + show(reloaded); + }, this::removalFailed); + }, this::removalFailed); + } + + private void removalFailed() { + removing = false; + updateButtons(); + } + + private static RbacServletInterface rbac(Frame parent) { + return parent.mirthClient.getServlet(RbacServletInterface.class); + } + + /** + * Runs {@code call} off the event thread, then {@code onSuccess} on it; a failure is shown over {@code owner}, + * then {@code onFailure} runs, when given. + */ + private static void background(Frame parent, Component owner, Callable call, Consumer onSuccess, + Runnable onFailure) { + new SwingWorker() { + @Override + protected T doInBackground() throws Exception { + return call.call(); + } + + @Override + protected void done() { + try { + onSuccess.accept(get()); + } catch (ExecutionException e) { + if (e.getCause() instanceof ClientException) { + RoleTransferActions.report(parent, owner, (ClientException) e.getCause()); + } else { + parent.alertThrowable(owner, e.getCause() != null ? e.getCause() : e); + } + if (onFailure != null) { + onFailure.run(); + } + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + if (onFailure != null) { + onFailure.run(); + } + } + } + }.execute(); + } + + /** One row per orphaned permission: the role, then the permission. */ + private static class GrantModel extends AbstractTableModel { + + private static final String[] COLUMNS = {"Role", "Permission"}; + private final List rows = new ArrayList<>(); + + void set(List grants) { + rows.clear(); + if (grants != null) { + rows.addAll(grants); + } + fireTableDataChanged(); + } + + UnregisteredGrant get(int row) { + return rows.get(row); + } + + List all() { + return new ArrayList<>(rows); + } + + @Override + public int getRowCount() { + return rows.size(); + } + + @Override + public int getColumnCount() { + return COLUMNS.length; + } + + @Override + public String getColumnName(int column) { + return COLUMNS[column]; + } + + @Override + public Object getValueAt(int row, int column) { + UnregisteredGrant grant = rows.get(row); + return column == 0 ? grant.getRoleName() : grant.getPermission(); + } + } +} diff --git a/client/src/main/java/com/diridium/rbac/RbacSettingsPanel.java b/client/src/main/java/com/diridium/rbac/RbacSettingsPanel.java index e7c5445..d6ff362 100644 --- a/client/src/main/java/com/diridium/rbac/RbacSettingsPanel.java +++ b/client/src/main/java/com/diridium/rbac/RbacSettingsPanel.java @@ -86,6 +86,8 @@ public RbacSettingsPanel(String tabName) { initComponents(); addTask("doExportRoles", "Export Roles", "Export roles to a file.", "", new ImageIcon(Frame.class.getResource("images/report_go.png"))); addTask("doImportRoles", "Import Roles", "Import roles from a file.", "", new ImageIcon(Frame.class.getResource("images/report_disk.png"))); + addTask("doShowOrphanedPermissions", OrphanedPermissionsDialog.TITLE, OrphanedPermissionsDialog.TOOLTIP, "", + new ImageIcon(Frame.class.getResource("images/plugin_delete.png"))); } /** Task callback: Export Roles. */ @@ -94,6 +96,9 @@ public RbacSettingsPanel(String tabName) { /** Task callback: Import Roles. */ public void doImportRoles() { transfer.importRoles(); } + /** Task callback: Orphaned Permissions. */ + public void doShowOrphanedPermissions() { OrphanedPermissionsDialog.open(parent, this::doRefresh); } + private void initComponents() { setLayout(new BorderLayout()); diff --git a/client/src/main/java/com/mirth/connect/plugins/auth/client/SecureAuthorizationController.java b/client/src/main/java/com/mirth/connect/plugins/auth/client/SecureAuthorizationController.java index 6b21c2a..26c72db 100644 --- a/client/src/main/java/com/mirth/connect/plugins/auth/client/SecureAuthorizationController.java +++ b/client/src/main/java/com/mirth/connect/plugins/auth/client/SecureAuthorizationController.java @@ -56,7 +56,8 @@ public class SecureAuthorizationController implements AuthorizationController { // Web twin: "adminOnlyTasks" in webadmin/web/task-permission-map.json. private static final Set ADMIN_ONLY_TASKS = Set.of( TaskConstants.SETTINGS_KEY_PREFIX + RbacServletInterface.PLUGIN_NAME + "/doExportRoles", - TaskConstants.SETTINGS_KEY_PREFIX + RbacServletInterface.PLUGIN_NAME + "/doImportRoles"); + TaskConstants.SETTINGS_KEY_PREFIX + RbacServletInterface.PLUGIN_NAME + "/doImportRoles", + TaskConstants.SETTINGS_KEY_PREFIX + RbacServletInterface.PLUGIN_NAME + "/doShowOrphanedPermissions"); /** Looks up the id of the signed-in user; a seam so tests need no running client. */ @FunctionalInterface diff --git a/client/src/test/java/com/diridium/rbac/OrphanedPermissionsDialogTest.java b/client/src/test/java/com/diridium/rbac/OrphanedPermissionsDialogTest.java new file mode 100644 index 0000000..42786a8 --- /dev/null +++ b/client/src/test/java/com/diridium/rbac/OrphanedPermissionsDialogTest.java @@ -0,0 +1,26 @@ +// SPDX-FileCopyrightText: Copyright 2025-2026 Diridium Technologies Inc. +// SPDX-License-Identifier: MPL-2.0 + +package com.diridium.rbac; + +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNull; + +import java.util.List; + +import org.junit.jupiter.api.Test; + +class OrphanedPermissionsDialogTest { + + @Test + void confirmation_countsEachRoleOnce() { + assertEquals("Remove 2 orphaned permissions from 1 role?", OrphanedPermissionsDialog.confirmation(List.of( + new UnregisteredGrant(2, "Billing", "A"), new UnregisteredGrant(2, "Billing", "B")))); + } + + @Test + void disabledLine_isAbsentWithNoDisabledPlugin() { + assertNull(OrphanedPermissionsDialog.disabledLine(List.of())); + assertNull(OrphanedPermissionsDialog.disabledLine(null)); + } +} diff --git a/client/src/test/java/com/diridium/rbac/OrphanedPermissionsTextsTest.java b/client/src/test/java/com/diridium/rbac/OrphanedPermissionsTextsTest.java new file mode 100644 index 0000000..4622d6a --- /dev/null +++ b/client/src/test/java/com/diridium/rbac/OrphanedPermissionsTextsTest.java @@ -0,0 +1,76 @@ +// SPDX-FileCopyrightText: Copyright 2025-2026 Diridium Technologies Inc. +// SPDX-License-Identifier: MPL-2.0 + +package com.diridium.rbac; + +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertTrue; + +import java.io.IOException; +import java.nio.charset.StandardCharsets; +import java.nio.file.Files; +import java.nio.file.Path; +import java.nio.file.Paths; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + +import org.junit.jupiter.api.Test; + +/** + * The Swing Orphaned Permissions dialog shows the texts in webadmin/web/orphaned-permissions-texts.txt; the web + * dialog's orphaned-permissions.test.mjs reads the same file. + */ +class OrphanedPermissionsTextsTest { + + @Test + void theSharedTexts_areTheOnesTheSwingDialogShows() throws IOException { + Path file = Paths.get(System.getProperty("basedir", ".")).resolve("../webadmin/web/orphaned-permissions-texts.txt") + .normalize(); + List wrong = new ArrayList<>(); + int checked = 0; + for (String line : Files.readAllLines(file, StandardCharsets.UTF_8)) { + if (line.isBlank() || line.startsWith("#")) { + continue; + } + String[] parts = line.split(" ", 2); + String expected = parts[1]; + String shown; + switch (parts[0]) { + case "title" -> shown = OrphanedPermissionsDialog.TITLE; + case "tooltip" -> shown = OrphanedPermissionsDialog.TOOLTIP; + case "intro" -> shown = OrphanedPermissionsDialog.INTRO; + case "empty" -> shown = OrphanedPermissionsDialog.EMPTY; + case "disabled" -> { + String[] io = parts[1].split(" => ", 2); + expected = io[1]; + shown = OrphanedPermissionsDialog.disabledLine(Arrays.asList(io[0].split(", "))); + } + case "confirmation" -> { + String[] io = parts[1].split(" => ", 2); + String[] counts = io[0].split(" "); + expected = io[1]; + shown = OrphanedPermissionsDialog.confirmation(grants(Integer.parseInt(counts[0]), + Integer.parseInt(counts[1]))); + } + default -> shown = "unknown key " + parts[0]; + } + if (!expected.equals(shown)) { + wrong.add(line + " (Swing shows: " + shown + ")"); + } + checked++; + } + assertTrue(checked >= 8, "read only " + checked + " texts from " + file); + assertEquals(List.of(), wrong); + } + + /** {@code permissions} grants spread over {@code roles} roles, every role holding at least one. */ + private static List grants(int permissions, int roles) { + List grants = new ArrayList<>(); + for (int i = 0; i < permissions; i++) { + int role = Math.min(i, roles - 1) + 1; + grants.add(new UnregisteredGrant(role, "Role " + role, "Permission " + i)); + } + return grants; + } +} diff --git a/client/src/test/java/com/mirth/connect/plugins/auth/client/SecureAuthorizationControllerTest.java b/client/src/test/java/com/mirth/connect/plugins/auth/client/SecureAuthorizationControllerTest.java index 3c594b7..04fd2f8 100644 --- a/client/src/test/java/com/mirth/connect/plugins/auth/client/SecureAuthorizationControllerTest.java +++ b/client/src/test/java/com/mirth/connect/plugins/auth/client/SecureAuthorizationControllerTest.java @@ -297,12 +297,14 @@ void checkTask_exportAndImportRoles_followTheAdminFlag() throws Exception { setField(admin, "adminRole", true); assertTrue(admin.checkTask(RBAC_GROUP, "doExportRoles")); assertTrue(admin.checkTask(RBAC_GROUP, "doImportRoles")); + assertTrue(admin.checkTask(RBAC_GROUP, "doShowOrphanedPermissions")); // Holding every permission (View and Manage Roles) is not the admin role. SecureAuthorizationController notAdmin = withPermissions( Set.of(RbacServletInterface.PERMISSION_VIEW, RbacServletInterface.PERMISSION_MANAGE)); assertFalse(notAdmin.checkTask(RBAC_GROUP, "doExportRoles")); assertFalse(notAdmin.checkTask(RBAC_GROUP, "doImportRoles")); + assertFalse(notAdmin.checkTask(RBAC_GROUP, "doShowOrphanedPermissions")); } @Test diff --git a/docs/design-notes.md b/docs/design-notes.md index a441a4c..51407de 100644 --- a/docs/design-notes.md +++ b/docs/design-notes.md @@ -257,3 +257,20 @@ Both editors check a new or changed name or description with the server's rule b - The case file has 25 strings and the two messages. Both tests also check that a name or description the role already has is not refused. - The CI browser tests (`role-editor.spec.js`) check the web editor: a tab in a new name and a bell in a changed description each show the message, the editor stays open, and nothing is sent. The Swing editor's check has no CI test; it was checked only by driving the Swing Administrator on OIE 4.7.0. - Both editors were driven on OIE 4.7.0: a tab in the name and a bell in the description each show the message, the editor stays open, and the role is unchanged. + +## 2026-11-25: the Orphaned Permissions dialog + +A role keeps a plugin's permission after the plugin renames it or is removed, and such a grant does nothing (see the 2026-11-23 entry, "grants no plugin registers"). An admin can list and remove them with the Orphaned Permissions task in the RBAC tab, in both Administrators. The dialog only removes grants; granting a renamed permission's new name stays in the role editor. + +The engine's own permissions are never listed or removed. rbac reads them from the engine's `Permissions` class, and if that read fails it lists nothing rather than every grant. The engine registers the plugins' permissions after every plugin has started, and rbac lists nothing before that. To know whether they are registered, rbac checks for its own View Roles permission. Removal checks each grant again on the server and deletes the picked ones in one transaction. + +A disabled plugin registers no permissions, so its grants are listed too. Measured on OIE 4.7.0: with Data Pruner disabled, the engine still listed it among the installed plugins and reported it disabled, and its three permissions left rbac's list. The dialog names the disabled plugins above the table. It has no column naming each grant's plugin: rbac doesn't remember which plugin registered a permission, so every row would say "unknown". + +The list and removal are admin-only, like role export and import. + +### Tests + +- Unit tests: only grants neither the engine nor a plugin registers are listed; nothing is listed when the engine's permissions can't be read or the plugins' aren't registered yet; a removal takes only requested grants that are still orphaned and audits each role; anyone without the admin role is refused; the dialog's singular and plural texts; the admin-only task in both task maps. +- Browser tests: who sees the task, the list with the disabled plugins, Remove Selected and Remove All with their confirmations, and an empty list. +- The e2e suite: a made-up grant is listed and no registered permission is, a View Roles and Manage Roles holder who is not the admin is refused both calls, and a removal takes the made-up grant and leaves the engine permission. +- Both dialogs, driven on OIE 4.7.0 with a role still holding "Use Perm Test", the permission of a throwaway test plugin that doesn't ship, after the plugin's version 2 renamed it: both listed it, and the web dialog removed a made-up grant while that role kept its engine permissions. diff --git a/e2e/checks.py b/e2e/checks.py index acf392c..a2b8e65 100644 --- a/e2e/checks.py +++ b/e2e/checks.py @@ -5,6 +5,7 @@ admin's session, the test users' sessions and ids, the roles and the channels the scenario made.""" import types +import xml.etree.ElementTree as ET import urllib.parse import rbac as b @@ -421,6 +422,48 @@ def unregistered_grant(r, w): f"unassign HTTP {unassigned}, delete HTTP {deleted}") +def orphaned_permissions(r, w): + """The admin-only Orphaned Permissions list and removal. A role holding a permission no plugin registers is + listed, nothing the engine or a plugin registers is, a removal takes only what is still orphaned, and a View Roles + and Manage Roles holder who is not the admin role is refused both calls.""" + name, perm = "rbac e2e orphaned", "rbac e2e orphaned permission" + rid = b.create_role(w.api, name, ["viewDashboard", "viewChannels", perm]) + status, text = w.api.request("GET", b.RBAC + "/roles/_unregistered") + rows = set() + if status == 200: + rows = {(g.findtext("roleId"), g.findtext("permission")) + for g in ET.fromstring(text).iter("com.diridium.rbac.UnregisteredGrant")} + r.check("orphaned permissions: the admin's list has the made-up grant", (str(rid), perm) in rows, + f"HTTP {status}: {sorted(rows)[:5]}") + registered = {p for _, p in rows} & b.available_permissions(w.api) + r.check("orphaned permissions: nothing the engine or a plugin registers is listed", not registered, + f"listed: {sorted(registered)}") + + removal = ("" + + "".join(f"{rid}{p}" + "" for p in (perm, "viewDashboard")) + + "") + w.roles["orphan_manager"] = b.create_role(w.api, "rbac e2e roles manager", + ["viewDashboard", "viewChannels", "View Roles", "Manage Roles"]) + manager = add_user(w, "orphanmanager", "orphan_manager") + expect(r, "orphaned permissions: a View Roles and Manage Roles holder is refused the list", manager, "GET", + b.RBAC + "/roles/_unregistered", (403,), "Listing orphaned permissions needs the admin role.") + expect(r, "orphaned permissions: and the removal", manager, "POST", b.RBAC + "/roles/_unregistered/_remove", + (403,), "Removing orphaned permissions needs the admin role.", body=removal) + + status, text = w.api.request("POST", b.RBAC + "/roles/_unregistered/_remove", removal) + removed = ET.fromstring(text).text if status == 200 and text.strip() else None + held = b.roles(w.api)[rid]["permissions"] + r.check("orphaned permissions: the removal takes the made-up grant and leaves the engine's", + status == 200 and removed == "1" and held == {"viewDashboard", "viewChannels"}, + f"HTTP {status} removed={removed!r} role now holds {sorted(held)}") + + unassigned, _ = b.remove_role(w.api, w.ids["orphanmanager"]) + deleted = [b.delete_role(w.api, x)[0] for x in (rid, w.roles.pop("orphan_manager"))] + r.check("orphaned permissions: its roles are removed again", unassigned in (200, 204) + and all(d in (200, 204) for d in deleted), f"unassign HTTP {unassigned}, delete HTTP {deleted}") + + def user_preferences(r, w): """A user's preferences: their own for any role, another user's only with manageUsers. rbac decides this itself, whatever the engine labels, and a write it refuses changes nothing. The engine asks rbac even for a user's own diff --git a/e2e/scenarios.py b/e2e/scenarios.py index 046ae16..bac45e5 100644 --- a/e2e/scenarios.py +++ b/e2e/scenarios.py @@ -173,6 +173,7 @@ def fresh(r, engine, db, dbname, new_zip, **_): k.user_preferences(r, w) k.unsafe_names(r, w) k.unregistered_grant(r, w) + k.orphaned_permissions(r, w) k.unknown_operations(r, engine) # Deleting an engine user: the engine tells no plugin, but it asks rbac to authorize the delete first, so diff --git a/package/resources/sqlmap.xml b/package/resources/sqlmap.xml index 7b0e711..203dcaf 100644 --- a/package/resources/sqlmap.xml +++ b/package/resources/sqlmap.xml @@ -85,6 +85,10 @@ INSERT INTO rbac_role_permission (role_id, permission) VALUES (#{roleId}, #{permission}) + + DELETE FROM rbac_role_permission WHERE role_id = #{roleId} AND permission = #{permission} + + setTicked((set) => toggleIn(set, keyOf(grant)))} /> + {grant.roleName} + + + {grant.permission} + + ))} + + + + )} + + ); + } + + return { startOrphaned, OrphanedPermissionsDialog }; +} diff --git a/webadmin/web/orphaned-permissions.test.mjs b/webadmin/web/orphaned-permissions.test.mjs new file mode 100644 index 0000000..4531669 --- /dev/null +++ b/webadmin/web/orphaned-permissions.test.mjs @@ -0,0 +1,82 @@ +// SPDX-FileCopyrightText: Copyright 2026 Diridium Technologies Inc. +// SPDX-License-Identifier: MPL-2.0 + +/* + * The Orphaned Permissions dialog's texts (rbac-core.js) and the list and removal on the wire + * (rbac-api.js). The Swing twin is OrphanedPermissionsDialog. + * + * Run: npm test (from webadmin/; node --test web/) + */ + +import test from 'node:test'; +import assert from 'node:assert/strict'; +import fs from 'node:fs'; +import { + orphanedConfirmation, orphanedDisabledLine, ORPHANED_INTRO, ORPHANED_EMPTY, + TASK_ORPHANED_PERMISSIONS, TASK_ORPHANED_PERMISSIONS_TOOLTIP +} from './rbac-core.js'; +import { normalizeUnregisteredGrants, unregisteredGrantsXml } from './rbac-api.js'; + +const grant = (roleId, roleName, permission) => ({ roleId, roleName, permission }); + +// The texts the Swing dialog shows too: OrphanedPermissionsTextsTest reads the same file. +test('the shared texts are the ones the web dialog shows', () => { + const lines = fs.readFileSync(new URL('./orphaned-permissions-texts.txt', import.meta.url), 'utf8') + .split('\n').filter((line) => line.trim() && !line.startsWith('#')); + assert.ok(lines.length >= 8, `read only ${lines.length} texts`); + const fixed = { title: TASK_ORPHANED_PERMISSIONS, tooltip: TASK_ORPHANED_PERMISSIONS_TOOLTIP, + intro: ORPHANED_INTRO, empty: ORPHANED_EMPTY }; + for (const line of lines) { + const key = line.slice(0, line.indexOf(' ')); + const rest = line.slice(key.length + 1); + if (key in fixed) { + assert.equal(fixed[key], rest, line); + } else if (key === 'disabled') { + const [plugins, text] = rest.split(' => '); + assert.equal(orphanedDisabledLine(plugins.split(', ')), text, line); + } else if (key === 'confirmation') { + const [counts, text] = rest.split(' => '); + const [permissions, roles] = counts.split(' ').map(Number); + const grants = Array.from({ length: permissions }, + (_, i) => grant(Math.min(i, roles - 1) + 1, 'Role', `Permission ${i}`)); + assert.equal(orphanedConfirmation(grants), text, line); + } else { + assert.fail(`unknown key in ${line}`); + } + } +}); + +test('the confirmation counts a role id sent as text and as a number once', () => { + assert.equal(orphanedConfirmation([grant(2, 'Billing', 'A'), grant('2', 'Billing', 'B')]), + 'Remove 2 orphaned permissions from 1 role?'); +}); + +test('the disabled line is absent with no disabled plugin', () => { + assert.equal(orphanedDisabledLine([]), null); + assert.equal(orphanedDisabledLine(undefined), null); +}); + +test('the list reads several grants, one grant, and none', () => { + const several = normalizeUnregisteredGrants({ 'com.diridium.rbac.UnregisteredGrants': { + grants: { 'com.diridium.rbac.UnregisteredGrant': [ + { roleId: 2, roleName: 'Billing', permission: 'Old Perm' }, + { roleId: '3', roleName: 'Lab', permission: 'Use Perm Test' }] }, + disabledPlugins: { string: ['Data Pruner', 'Server Log'] } } }); + assert.deepEqual(several, { + grants: [grant(2, 'Billing', 'Old Perm'), grant(3, 'Lab', 'Use Perm Test')], + disabledPlugins: ['Data Pruner', 'Server Log'] }); + const one = normalizeUnregisteredGrants({ 'com.diridium.rbac.UnregisteredGrants': { + grants: { 'com.diridium.rbac.UnregisteredGrant': { roleId: 2, roleName: 'Billing', permission: 'Old' } }, + disabledPlugins: { string: 'Data Pruner' } } }); + assert.deepEqual(one, { grants: [grant(2, 'Billing', 'Old')], disabledPlugins: ['Data Pruner'] }); + assert.deepEqual(normalizeUnregisteredGrants({ 'com.diridium.rbac.UnregisteredGrants': { grants: '', disabledPlugins: '' } }), + { grants: [], disabledPlugins: [] }); +}); + +test('the removal sends each grant\'s role id and permission, escaped', () => { + assert.equal(unregisteredGrantsXml([grant(2, 'Billing', 'A & '), grant(3, 'Lab', 'Old')]), + '' + + '2A & <B>' + + '3Old' + + ''); +}); diff --git a/webadmin/web/parity-artifact.test.mjs b/webadmin/web/parity-artifact.test.mjs index 3b4558c..1a62333 100644 --- a/webadmin/web/parity-artifact.test.mjs +++ b/webadmin/web/parity-artifact.test.mjs @@ -58,6 +58,7 @@ test('adminOnlyTasks equals ADMIN_ONLY_TASKS exactly, in the same order', () => assert.deepEqual(artifact.adminOnlyTasks, [ 'settings_Role-Based Access Control/doExportRoles', 'settings_Role-Based Access Control/doImportRoles', + 'settings_Role-Based Access Control/doShowOrphanedPermissions', ]); }); diff --git a/webadmin/web/rbac-api.js b/webadmin/web/rbac-api.js index 80165b0..305c465 100644 --- a/webadmin/web/rbac-api.js +++ b/webadmin/web/rbac-api.js @@ -222,6 +222,29 @@ export function roleXml(role, { includeId = false } = {}) { /* ---- REST client (the servlet endpoints) --------------------------------- */ +const GRANTS_FQCN = 'com.diridium.rbac.UnregisteredGrants'; +const GRANT_FQCN = 'com.diridium.rbac.UnregisteredGrant'; + +/* The orphaned permissions (com.diridium.rbac.UnregisteredGrants): the grants as {roleId, + roleName, permission}, and the names of the installed plugins that are disabled. */ +export function normalizeUnregisteredGrants(raw) { + if (raw && typeof raw === 'object' && raw[GRANTS_FQCN] !== undefined) raw = raw[GRANTS_FQCN]; + if (!raw || typeof raw !== 'object') raw = {}; + return { + grants: beanList(raw.grants, GRANT_FQCN).map((g) => ({ + roleId: Number(g.roleId), roleName: text(g.roleName), permission: text(g.permission) + })), + disabledPlugins: [...stringSet(raw.disabledPlugins)] + }; +} + +/* The removal request: each grant's role id and permission. */ +export function unregisteredGrantsXml(grants) { + const items = grants.map((g) => `<${GRANT_FQCN}>${Number(g.roleId)}` + + `${escapeXml(g.permission)}`).join(''); + return `<${GRANTS_FQCN}>${items}`; +} + export function makeApi(api) { // Roles come back {list:{'com.diridium.rbac.Role':[...]}}; tolerate an // aliased 'role' root too (schi precedent for FQCN/alias drift). @@ -257,6 +280,10 @@ export function makeApi(api) { params: { dryRun, applyChannels, matchChannelsByName, pick, planToken }, contentType: 'text/plain' })), + // Orphaned permissions (admin only): the list, and the removal of the picked ones. + getUnregisteredGrants: async () => normalizeUnregisteredGrants(await api.get(`${EXT}/roles/_unregistered`)), + removeUnregisteredGrants: (grants) => + api.postXml(`${EXT}/roles/_unregistered/_remove`, unregisteredGrantsXml(grants)), getExtensionTaskPermissions: async () => Object.fromEntries(mapEntries(await api.get(`${EXT}/task-permissions`))), // Permission display name -> publishing plugin name; drives the diff --git a/webadmin/web/rbac-core.js b/webadmin/web/rbac-core.js index e63a6f6..c232074 100644 --- a/webadmin/web/rbac-core.js +++ b/webadmin/web/rbac-core.js @@ -407,3 +407,26 @@ export const TITLE_ASSIGN_ROLE = 'Assign Role'; export const ASSIGN_PREVIEW_HEADER = 'Review the access this role grants before assigning:'; export const ASSIGN_PREVIEW_FOOTER = 'This assignment takes effect immediately.'; export const TITLE_CONFIRM_ASSIGNMENT = 'Confirm Role Assignment'; + +// OrphanedPermissionsDialog: the admin-only Orphaned Permissions task and dialog, the +// permissions roles hold that neither the engine nor any installed plugin registers. +export const TASK_ORPHANED_PERMISSIONS = 'Orphaned Permissions'; +export const TASK_ORPHANED_PERMISSIONS_TOOLTIP = 'Remove orphaned permissions.'; +export const ORPHANED_INTRO = 'These permissions are orphaned, usually because a plugin changed or was removed. ' + + 'Engine permissions are never listed here.'; +export const ORPHANED_EMPTY = 'No role holds an orphaned permission.'; +export const ORPHANED_COLUMNS = ['Role', 'Permission']; + +/** OrphanedPermissionsDialog.disabledLine: the line naming the disabled plugins, or null when none is. */ +export function orphanedDisabledLine(plugins) { + return plugins && plugins.length + ? `Disabled plugins: ${plugins.join(', ')}. Their permissions may appear in this list.` + : null; +} + +/** OrphanedPermissionsDialog.confirmation: "Remove 3 orphaned permissions from 2 roles?". */ +export function orphanedConfirmation(grants) { + const roles = new Set(grants.map((g) => String(g.roleId))).size; + return `Remove ${grants.length} orphaned permission${grants.length === 1 ? '' : 's'} from ` + + `${roles} role${roles === 1 ? '' : 's'}?`; +} diff --git a/webadmin/web/roles-panel.jsx b/webadmin/web/roles-panel.jsx index f2fd837..4018ed1 100644 --- a/webadmin/web/roles-panel.jsx +++ b/webadmin/web/roles-panel.jsx @@ -12,9 +12,10 @@ * no save()), and says so up front via the italic notice. * * Task pane = Refresh (settings_Role-Based Access Control/doRefresh → - * "View Roles") plus Export Roles and Import Roles, shown to the admin role - * only (the controller answers doExportRoles/doImportRoles from the admin - * flag; see role-transfer.jsx); the Add/Edit/Delete and Assign/Remove buttons are gated on + * "View Roles") plus Export Roles, Import Roles and Orphaned Permissions, + * shown to the admin role only (the controller answers doExportRoles, + * doImportRoles and doShowOrphanedPermissions from the admin flag; see + * role-transfer.jsx and orphaned-permissions.jsx); the Add/Edit/Delete and Assign/Remove buttons are gated on * checkTask(…, 'doSave') → "Manage Roles" (the Config Map Add Row precedent). * The assignments table and its Assign and Remove are user-assignments.jsx; * this panel loads its data with everything else. @@ -26,7 +27,8 @@ import { IMMEDIATE_NOTICE, ROLE_COLUMNS, MSG_CATALOG_NOT_LOADED, MSG_CHANNELS_NOT_LOADED, MSG_SELECT_ROLE_EDIT, MSG_SELECT_ROLE_DELETE, - MSG_ADMIN_ROLE_CANNOT_DELETE, deleteRoleConfirmText, TITLE_CONFIRM_DELETE, lookUpRoleNames + MSG_ADMIN_ROLE_CANNOT_DELETE, deleteRoleConfirmText, TITLE_CONFIRM_DELETE, lookUpRoleNames, + TASK_ORPHANED_PERMISSIONS, TASK_ORPHANED_PERMISSIONS_TOOLTIP } from './rbac-core.js'; import { TASK_EXPORT_ROLES, TASK_EXPORT_ROLES_TOOLTIP, TASK_IMPORT_ROLES, TASK_IMPORT_ROLES_TOOLTIP @@ -35,6 +37,7 @@ import { mapEntries } from './rbac-api.js'; import { makeRoleEditor } from './role-editor.jsx'; import { makeRoleTransfer } from './role-transfer.jsx'; import { makeUserAssignments } from './user-assignments.jsx'; +import { makeOrphanedPermissions } from './orphaned-permissions.jsx'; const RBAC_GROUP = 'settings_Role-Based Access Control'; @@ -44,6 +47,7 @@ export function registerRolesPanel(platform, api) { const RoleEditor = makeRoleEditor(platform); const { startExport, startImport, TransferDialogs } = makeRoleTransfer(platform, api); const UserAssignments = makeUserAssignments(platform, api); + const { startOrphaned, OrphanedPermissionsDialog } = makeOrphanedPermissions(platform, api); function RolesPanel({ setTasks }) { const [roles, setRoles] = React.useState([]); @@ -57,6 +61,7 @@ export function registerRolesPanel(platform, api) { const [selectedRoleId, setSelectedRoleId] = React.useState(null); const [editor, setEditor] = React.useState(null); // { role: Role|null } while open const [transfer, setTransfer] = React.useState(null); // export/import dialog value while open + const [orphaned, setOrphaned] = React.useState(null); // the orphaned-permissions list while open const [loading, setLoading] = React.useState(true); const channelMapRef = React.useRef(null); // the export task reads the channel names, null when not loaded @@ -129,7 +134,9 @@ export function registerRolesPanel(platform, api) { ui.taskButton(TASK_EXPORT_ROLES, 'export', async () => setTransfer(await startExport(channelMapRef.current)), { task: 'doExportRoles', group: RBAC_GROUP, title: TASK_EXPORT_ROLES_TOOLTIP }), ui.taskButton(TASK_IMPORT_ROLES, 'import', async () => setTransfer(await startImport()), - { task: 'doImportRoles', group: RBAC_GROUP, title: TASK_IMPORT_ROLES_TOOLTIP }) + { task: 'doImportRoles', group: RBAC_GROUP, title: TASK_IMPORT_ROLES_TOOLTIP }), + ui.taskButton(TASK_ORPHANED_PERMISSIONS, 'trash', async () => setOrphaned(await startOrphaned()), + { task: 'doShowOrphanedPermissions', group: RBAC_GROUP, title: TASK_ORPHANED_PERMISSIONS_TOOLTIP }) ]); }, [load, setTasks]); @@ -270,6 +277,13 @@ export function registerRolesPanel(platform, api) { transfer={transfer} onClose={() => setTransfer(null)} onImported={() => { setTransfer(null); load(); }} /> + + {orphaned ? ( + setOrphaned(null)} + onRemoved={() => load()} /> + ) : null} ); } diff --git a/webadmin/web/task-permission-map.js b/webadmin/web/task-permission-map.js index dfd2217..c966775 100644 --- a/webadmin/web/task-permission-map.js +++ b/webadmin/web/task-permission-map.js @@ -238,6 +238,7 @@ export const GROUP_TASK_PERMISSIONS = { export const ADMIN_ONLY_TASKS = [ 'settings_Role-Based Access Control/doExportRoles', 'settings_Role-Based Access Control/doImportRoles', + 'settings_Role-Based Access Control/doShowOrphanedPermissions', ]; /** diff --git a/webadmin/web/task-permission-map.json b/webadmin/web/task-permission-map.json index 49762d9..aee2331 100644 --- a/webadmin/web/task-permission-map.json +++ b/webadmin/web/task-permission-map.json @@ -137,6 +137,7 @@ }, "adminOnlyTasks": [ "settings_Role-Based Access Control/doExportRoles", - "settings_Role-Based Access Control/doImportRoles" + "settings_Role-Based Access Control/doImportRoles", + "settings_Role-Based Access Control/doShowOrphanedPermissions" ] }