Class UiEntityContext

java.lang.Object
io.jmix.flowui.accesscontext.UiEntityContext
All Implemented Interfaces:
AccessContext

public class UiEntityContext extends Object implements 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

    Fields
    Modifier and Type
    Field
    Description
    protected boolean
     
    protected boolean
     
    protected boolean
     
    protected final MetaClass
     
    protected boolean
     
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    Returns 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.
    boolean
    Determines whether the "create" operation is permitted within the current context.
    boolean
    Determines whether the "delete" operation is permitted within the current context.
    boolean
    Determines whether the "edit" operation is permitted for the associated entity within the current context.
    boolean
    Determines whether the "view" operation is permitted for the associated entity within the current context.
    void
    Denies the "create" operation within the current context.
    void
    Denies the "delete" operation for the associated entity within the current context.
    void
    Denies the "edit" operation for the associated entity within the current context.
    void
    Denies the "view" operation for the associated entity within the current context.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • entityClass

      protected final MetaClass entityClass
    • createPermitted

      protected boolean createPermitted
    • viewPermitted

      protected boolean viewPermitted
    • editPermitted

      protected boolean editPermitted
    • deletePermitted

      protected boolean deletePermitted
  • Constructor Details

    • UiEntityContext

      public UiEntityContext(MetaClass entityClass)
  • Method Details

    • getEntityClass

      public MetaClass getEntityClass()
      Returns the metadata object representing the entity associated with the current context.
      Returns:
      the MetaClass instance representing the entity
    • isCreatePermitted

      public boolean isCreatePermitted()
      Determines whether the "create" operation is permitted within the current context.
      Returns:
      true if the "create" operation is allowed, false otherwise
    • 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:
      true if the "view" operation is allowed, false otherwise
    • 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:
      true if the "edit" operation is allowed, false otherwise
    • 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:
      true if the "delete" operation is allowed, false otherwise
    • 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

      @Nullable public String 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 interface AccessContext