Class UiComponentPolicyConstraint
java.lang.Object
io.jmix.uiconstraints.security.constraint.UiComponentPolicyConstraint
- All Implemented Interfaces:
AccessConstraint<UiComponentPolicyContext>
@NullMarked
@Component("uicns_UiComponentPolicyConstraint")
public class UiComponentPolicyConstraint
extends Object
implements AccessConstraint<UiComponentPolicyContext>
Answers a
UiComponentPolicyContext from the UI component policies assigned to the current user: a
policy with the DENY effect denies the corresponding permission, and a component that no policy
mentions is left permitted, since policies only restrict.
The constraint is registered by UiComponentPolicyConstraintsRegistration, so it takes part in
AccessManager.applyRegisteredConstraints(T) along with the constraints of other policy
types. An application may register a constraint of its own for the same context to restrict a component
further; note that the applier only asks about components some policy of the current user mentions.
- See Also:
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionUiComponentPolicyConstraint(CurrentUserUiComponentPolicies currentUserUiComponentPolicies) -
Method Summary
Modifier and TypeMethodDescriptionvoidapplyTo(UiComponentPolicyContext context) Applies the constraint to the given access context.Returns the access constraint type.
-
Field Details
-
currentUserUiComponentPolicies
-
-
Constructor Details
-
UiComponentPolicyConstraint
-
-
Method Details
-
getContextType
Description copied from interface:AccessConstraintReturns the access constraint type.- Specified by:
getContextTypein interfaceAccessConstraint<UiComponentPolicyContext>
-
applyTo
Description copied from interface:AccessConstraintApplies the constraint to the given access context.- Specified by:
applyToin interfaceAccessConstraint<UiComponentPolicyContext>
-