Class InMemoryCrudEntityContext

java.lang.Object
io.jmix.core.accesscontext.InMemoryCrudEntityContext
All Implemented Interfaces:
AccessContext

public class InMemoryCrudEntityContext extends Object implements AccessContext
An access context to check permissions on CRUD operations by testing predicates.
  • Field Details

    • entityClass

      protected final MetaClass entityClass
    • createPredicate

      protected BiPredicate createPredicate
    • readPredicate

      protected BiPredicate readPredicate
    • updatePredicate

      protected BiPredicate updatePredicate
    • deletePredicate

      protected BiPredicate deletePredicate
    • applicationContext

      protected org.springframework.context.ApplicationContext applicationContext
  • Constructor Details

    • InMemoryCrudEntityContext

      public InMemoryCrudEntityContext(MetaClass entityClass, org.springframework.context.ApplicationContext applicationContext)
  • Method Details

    • getEntityClass

      public MetaClass getEntityClass()
    • isCreatePermitted

      public boolean isCreatePermitted(Object entity)
    • createPredicate

      public BiPredicate createPredicate()
    • addCreatePredicate

      public void addCreatePredicate(BiPredicate predicate)
    • isReadPermitted

      public boolean isReadPermitted(Object entity)
    • readPredicate

      public BiPredicate readPredicate()
    • addReadPredicate

      public void addReadPredicate(BiPredicate predicate)
    • isUpdatePermitted

      public boolean isUpdatePermitted(Object entity)
    • updatePredicate

      public BiPredicate updatePredicate()
    • addUpdatePredicate

      public void addUpdatePredicate(BiPredicate predicate)
    • isDeletePermitted

      public boolean isDeletePermitted(Object entity)
    • deletePredicate

      public BiPredicate deletePredicate()
    • addDeletePredicate

      public void addDeletePredicate(BiPredicate predicate)
    • 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