Package io.jmix.flowui.accesscontext
Class UiEntityContext
java.lang.Object
io.jmix.flowui.accesscontext.UiEntityContext
- All Implemented Interfaces:
AccessContext
Defines an authorization context specific to operations on a particular entity.
Provides control over access permissions for create, view, edit, and delete operations
on the associated entity.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected booleanprotected booleanprotected booleanprotected final MetaClassprotected boolean -
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.Returns the metadata object representing the entity associated with the current context.booleanDetermines whether the "create" operation is permitted within the current context.booleanDetermines whether the "delete" operation is permitted within the current context.booleanDetermines whether the "edit" operation is permitted for the associated entity within the current context.booleanDetermines whether the "view" operation is permitted for the associated entity within the current context.voidDenies the "create" operation within the current context.voidDenies the "delete" operation for the associated entity within the current context.voidDenies the "edit" operation for the associated entity within the current context.voidDenies the "view" operation for the associated entity within the current context.
-
Field Details
-
entityClass
-
createPermitted
protected boolean createPermitted -
viewPermitted
protected boolean viewPermitted -
editPermitted
protected boolean editPermitted -
deletePermitted
protected boolean deletePermitted
-
-
Constructor Details
-
UiEntityContext
-
-
Method Details
-
getEntityClass
Returns the metadata object representing the entity associated with the current context.- Returns:
- the
MetaClassinstance representing the entity
-
isCreatePermitted
public boolean isCreatePermitted()Determines whether the "create" operation is permitted within the current context.- Returns:
trueif the "create" operation is allowed,falseotherwise
-
setCreateDenied
public void setCreateDenied()Denies the "create" operation within the current context. This method sets the permission state for the "create" operation to false, explicitly restricting the creation of the associated entity. -
isViewPermitted
public boolean isViewPermitted()Determines whether the "view" operation is permitted for the associated entity within the current context.- Returns:
trueif the "view" operation is allowed,falseotherwise
-
setViewDenied
public void setViewDenied()Denies the "view" operation for the associated entity within the current context. This method sets the permission state for the "view" operation to false, explicitly restricting the ability to view the entity. -
isEditPermitted
public boolean isEditPermitted()Determines whether the "edit" operation is permitted for the associated entity within the current context.- Returns:
trueif the "edit" operation is allowed,falseotherwise
-
setEditDenied
public void setEditDenied()Denies the "edit" operation for the associated entity within the current context. This method sets the permission state for the "edit" operation to false, explicitly restricting the editing of the associated entity. -
isDeletePermitted
public boolean isDeletePermitted()Determines whether the "delete" operation is permitted within the current context.- Returns:
trueif the "delete" operation is allowed,falseotherwise
-
setDeleteDenied
public void setDeleteDenied()Denies the "delete" operation for the associated entity within the current context. This method sets the permission state for the "delete" operation to false, explicitly restricting the deletion of the associated entity. -
explainConstraints
Description copied from interface:AccessContextReturns 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:
explainConstraintsin interfaceAccessContext
-