Package io.jmix.flowui.accesscontext
Class UiMenuContext
java.lang.Object
io.jmix.flowui.accesscontext.UiMenuContext
- All Implemented Interfaces:
AccessContext
Defines authorization point for UI menu items.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReturns a human-readable explanation of constraints applied to the current context instance for logging of authorization decisions.Retrieves the associated menu item.Retrieves the identifier of the associated menu item.boolean
Determines whether access is permitted in the current context.void
Denies access for the associated menu item by setting the permission state to false.
-
Field Details
-
permitted
protected boolean permitted
-
Constructor Details
-
Method Details
-
getMenuItemId
Retrieves the identifier of the associated menu item.- Returns:
- the menu item ID
-
getMenuItem
Retrieves the associated menu item.- Returns:
- the
MenuItem
instance associated with the context
-
isPermitted
public boolean isPermitted()Determines whether access is permitted in the current context.- Returns:
true
if access is permitted,false
otherwise
-
setDenied
public void setDenied()Denies access for the associated menu item by setting the permission state to false. This method is used to explicitly restrict access within the current context. -
explainConstraints
Description copied from interface:AccessContext
Returns a human-readable explanation of constraints applied to the current context instance for logging of authorization decisions. Null if the current context does not impose any constraints.- Specified by:
explainConstraints
in interfaceAccessContext
-