Skip to content

Conversation

@madsrasmussen
Copy link
Contributor

@madsrasmussen madsrasmussen commented Sep 22, 2025

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

@madsrasmussen madsrasmussen changed the title User fallback permission condition Permissions: Added User fallback permission condition Sep 22, 2025
@madsrasmussen madsrasmussen changed the title Permissions: Added User fallback permission condition Permissions: Added User fallback permission condition (closes #20097) Sep 22, 2025
@madsrasmussen madsrasmussen marked this pull request as ready for review September 22, 2025 19:09
Copilot AI review requested due to automatic review settings September 22, 2025 19:09
Copy link
Contributor

Copilot AI left a 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 UmbFallbackUserPermissionCondition class 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

Copy link
Member

@leekelleher leekelleher left a 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! 🚀

@leekelleher leekelleher merged commit 429f8b0 into main Oct 8, 2025
27 of 28 checks passed
@leekelleher leekelleher deleted the v16/bugfix/user-fallback-permission-condition branch October 8, 2025 15:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Umb.Condition.UserPermission.Document does not use fallback permissions for non-document entity types

3 participants