-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Permissions: Added User fallback permission condition (closes #20097) #20224
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
Permissions: Added User fallback permission condition (closes #20097) #20224
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 adds a fallback user permission condition system to the Umbraco CMS frontend, allowing permissions to be checked against a user's fallback permissions array. This addresses issue #20097 by providing a mechanism to evaluate user permissions with allOf and oneOf logic patterns.
Key Changes:
- Introduces a new
UmbFallbackUserPermissionConditionclass with configurable permission validation - Adds comprehensive test coverage for the permission condition logic
- Provides working examples demonstrating entity user permissions and actions
Reviewed Changes
Copilot reviewed 16 out of 16 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| src/Umbraco.Web.UI.Client/src/packages/user/user-permission/manifests.ts | Registers the new fallback permission condition manifest |
| src/Umbraco.Web.UI.Client/src/packages/user/user-permission/index.ts | Exports constants for external consumption |
| src/Umbraco.Web.UI.Client/src/packages/user/user-permission/fallback-permission-condition/types.ts | Defines TypeScript interfaces for the condition configuration |
| src/Umbraco.Web.UI.Client/src/packages/user/user-permission/fallback-permission-condition/manifests.ts | Manifest definition for the fallback permission condition |
| src/Umbraco.Web.UI.Client/src/packages/user/user-permission/fallback-permission-condition/fallback-user-permission.condition.ts | Core implementation of the permission checking logic |
| src/Umbraco.Web.UI.Client/src/packages/user/user-permission/fallback-permission-condition/fallback-user-permission.condition.test.ts | Unit tests covering all permission scenarios |
| src/Umbraco.Web.UI.Client/src/packages/user/user-permission/fallback-permission-condition/constants.ts | Constant definitions for the condition alias |
| src/Umbraco.Web.UI.Client/src/packages/user/user-permission/constants.ts | Re-exports fallback condition constants |
| src/Umbraco.Web.UI.Client/examples/user-permission/* | Example implementation showing how to use the new permission system |
...ges/user/user-permission/fallback-permission-condition/fallback-user-permission.condition.ts
Show resolved
Hide resolved
...ges/user/user-permission/fallback-permission-condition/fallback-user-permission.condition.ts
Show resolved
Hide resolved
src/Umbraco.Web.UI.Client/examples/user-permission/entity-action/action-1.ts
Show resolved
Hide resolved
src/Umbraco.Web.UI.Client/examples/user-permission/entity-action/action-2.ts
Show resolved
Hide resolved
leekelleher
left a comment
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.
Tested out with the user-permission example, works as expected! 🚀
This PR adds a condition to check if a verb is stored in the fallbackPermissions array on the Current User.
Fixes: #20097
The PR includes an example of how to set up the an entityUserPermission and apply the condition