-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Add third-party permissions section to user group workspace #19777
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
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this 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 third-party permissions system for user groups in the Umbraco backoffice. It enables extensions to register their own permission sections separate from the default permissions.
- Adds new
extensionPermissions
andextensionUserPermission
extension types - Creates base classes to reduce code duplication in permission components
- Implements a new third-party permissions section in the user group workspace
Reviewed Changes
Copilot reviewed 11 out of 11 changed files in this pull request and generated 4 comments.
Show a summary per file
File | Description |
---|---|
user-extension-permission.extension.ts | Defines new manifest interfaces for extension permissions |
types.ts | Exports the new extension permission types |
input-user-permission-base.element.ts | Creates shared base class for permission input components |
input-extension-user-permission/ | Implements extension-specific permission input component |
input-entity-user-permission/ | Refactors to extend the new base class |
components/index.ts | Exports new components and base class |
user-group-workspace-editor.element.ts | Adds third-party permissions section to UI |
user-group-permission-list-base.element.ts | Creates shared base class for permission list components |
user-group-extension-permission-list.element.ts | Implements extension permission list component |
user-group-entity-user-permission-list.element.ts | Refactors to extend the new base class |
en.ts | Adds localization for third-party permissions |
As part of the backoffice rebuild for Engage, we've realised we need the ability to render additional permissions on a user group. This can already be done via the
entityUserPermission
manifest, but falls a little short of what we need as the elements are rendered to theDefault permissions
section. We're not adding default permissions, we're adding third-party permissions. Functionally, we need to set verbs, but UI/UX-wise, we need separation and a little more control.To resolve this, I've introduced a new
extensionPermissions
extension type, and a newextensionUserPermission
extension type.extensionUserPermission
is very similar to the existingentityUserPermission
type, only with an additional property to declare the extension/package alias to which the permission belongs.extensionPermission
manifest then expects anextensionAlias
property, to establish the link between the two types.extensionPermission
extensions can optionally bring their own element to render above the permissions.To test, add the umbraco-package.json to
/App_Plugins/ExtensionPermissions
, and createelement.js
at the same location (content below). Visit a user group workspace, and marvel at the newly added Third-party permissions section (translations to come - wanted to open the PR for feedback first).Result should look like this:
