Skip to content

Add an Orphaned Permissions dialog to both Administrators - #71

Merged
pacmano1 merged 1 commit into
mainfrom
orphaned-permissions
Nov 25, 2026
Merged

pacmano1 merged 1 commit into
mainfrom
orphaned-permissions

Conversation

@pacmano1

Copy link
Copy Markdown
Contributor

Closes #64. A role keeps a plugin's permission after the plugin renames it or is removed, and the grant does nothing. PR #69 logs such a grant when one of the role's users is refused. This adds a way to list and remove them.

An admin opens the Orphaned Permissions task in the RBAC tab, in the Swing or the web Administrator, and gets a table of roles and permissions with Remove Selected, Remove All and Close. Above the table: "These permissions are orphaned, usually because a plugin changed or was removed. Engine permissions are never listed here." Granting a renamed permission's new name stays in the role editor.

  1. The engine's own permissions are never listed or removed. If rbac can't read them, or the plugins' permissions aren't registered yet (the engine registers them after every plugin has started), the server lists nothing and answers with a message saying so.
  2. The server checks each grant again before removing it, and removes the picked ones in one transaction.
  3. A disabled plugin registers no permissions, so its grants show up too. Measured on OIE 4.7.0: a disabled Data Pruner stays in the engine's list of installed plugins and reports disabled, and its permissions leave rbac's list. The dialog names disabled plugins above the table.
  4. Both calls are admin-only, like role export and import: refused in the controller and checked again in the service. Each removal writes one audit event per role.

Tests:

  • Server unit tests for the list, the refusals when rbac can't tell which permissions are registered, the removal and the admin-only refusals; the admin-only task in both task maps; web unit tests for the dialog's wording and the REST payload. The dialog texts are in one file that a Java test and a web test both read.
  • Five browser tests, run by the CI browser job: who sees the task, the list with the disabled plugins, Remove Selected and Remove All with their confirmations, and an empty list. The whole browser suite passed locally against web client 1.3.0 (89 tests).
  • An e2e check on a real engine: a made-up grant is listed and nothing registered 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. The whole e2e suite (fresh install, upgrades from 1.1.2, 1.1.3, 1.1.4 and 1.2.0, uninstall) passed on OIE 4.7.0 with each database: Derby 335 checks, MySQL 348, Postgres 349, Oracle 341, SQL Server 348 with the jTDS driver and 348 with Microsoft's, no failures.
  • Both dialogs on OIE 4.7.0, with a role still holding "Use Perm Test" after a throwaway test plugin renamed that permission in its version 2: both listed it, and the web dialog removed a made-up grant while that role kept its engine permissions.

Issue #64 also proposed a rename call that plugins could use. This PR doesn't add it.

Co-authored with Claude Code.

A role keeps a plugin's permission after the plugin renames it or is
removed, and such a grant does nothing. PR #69 logs it when one of the
role's users is refused. An admin can now list and remove these grants
with the Orphaned Permissions task in the RBAC tab, in the Swing and
web Administrators. Granting a renamed permission's new name stays in
the role editor.

- GET /roles/_unregistered lists the permissions roles hold that
  neither the engine nor an installed plugin registers, and the names
  of the installed plugins that are disabled. POST
  /roles/_unregistered/_remove removes the picked ones, each checked
  again, in one transaction, with one audit event per role. Both are
  admin-only, in the controller and again in UnregisteredGrantService.
- The engine's own permissions are never listed or removed. Nothing is
  listed when rbac can't read them, or before the plugins' permissions
  are registered.
- The dialog names disabled plugins above the table. Measured on OIE
  4.7.0: a disabled Data Pruner stays among the installed plugins, and
  its permissions leave rbac's list.

Tests: server unit tests for the list, the refusals and the removal; the
admin-only task in both task maps; web unit tests for the dialog's
wording and the REST payload; a text file both clients' tests read, so
the two dialogs show the same texts; browser tests for the dialog; an
e2e check, run on all six databases.

Closes #64

Co-Authored-By: Claude <noreply@anthropic.com>
@pacmano1
pacmano1 merged commit ccc9c99 into main Nov 25, 2026
20 checks passed
@pacmano1
pacmano1 deleted the orphaned-permissions branch November 25, 2026 23:06
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.

A renamed extension permission strands its grants; roles lose access with nothing logged

1 participant