move per-user plugin grants to the user's page
Nightly Build / build (push) Successful in 7m16s

Granting was a checklist of every user on each plugin's page, so "what may
this person use?" meant opening every plugin in turn — and the answer lived
on N pages while the connector half of it already lived on one. Both grant
sections now sit together on #users/{id}: same row list, same disabled chip,
same replace-the-whole-set save. The plugin's own page keeps a read-only
roster of who holds it, linking back to each person.

- db: plugin_access::set_for_user, the per-user twin of set_for_user on
  mcp_catalog_access; set_access stays as the inverse read model
- PluginManager: list_grants_for_user / set_grants_for_user, which omit and
  reject manages_own_access plugins (a box that controls nothing is worse
  than no box)
- GET/PUT /api/users/{id}/plugins, mounted next to /users/{id}/connectors;
  PUT /api/plugins/{id}/access is gone, GET remains as the roster

No push after the write, unlike a connector grant: that one gates a runtime
snapshotted at login, while a plugin grant is re-read from plugin_access on
every request that depends on it (sidebar pages, /plugins/mine, and each
inbound channel message), so a revoke lands with no bus event.

Docs updated with where access is granted, and why mobile-connector is
absent from that list.
This commit is contained in:
2026-07-29 11:36:47 +01:00
parent 8bcf09a67e
commit da8a835d70
15 changed files with 327 additions and 93 deletions
+8 -3
View File
@@ -892,9 +892,9 @@ export default {
'plugin_page.loading': 'Loading…',
'plugin_page.unavailable': 'This page is not available (plugin disabled or page not granted).',
'plugins.badge.user_page': 'user page',
'plugins.access.desc': 'Tick a box to let that person see and configure this plugin. Saving replaces the whole list.',
'plugins.access.empty': 'No users.',
'plugins.access.save': 'Save access',
'plugins.access.desc': 'Who can see and use this plugin. Access is granted on each person\'s own page, next to their connectors. Admins always have access.',
'plugins.access.nobody': 'Nobody has been granted this plugin yet.',
'plugins.access.manage': 'Manage access from Users',
'plugins.error.required': '"{field}" is required.',
'plugins.catalog.configure': 'Configure',
'plugins.health.ok': 'active',
@@ -1065,6 +1065,7 @@ export default {
'users.detail.back': 'Users',
'users.detail.profile': 'Profile',
'users.detail.connectors': 'Connectors',
'users.detail.plugins': 'Plugins',
'users.detail.security': 'Security',
'users.detail.saved': 'Saved',
'users.detail.delete_hint': 'Deletes this user, their database and all conversation history.',
@@ -1077,6 +1078,10 @@ export default {
'users.conn.empty': 'No connectors registered yet.',
'users.conn.disabled': 'disabled',
'users.plug.hint': 'Tick a plugin to let this user see and use it. A disabled plugin can be granted now and will appear once you enable it.',
'users.plug.empty': 'No plugins available.',
'users.plug.admin_note': 'Admins can use every enabled plugin, whatever is ticked here.',
'users.modal.create_title': 'New user',
'users.modal.username': 'Username',
'users.modal.display_name': 'Display name',