Annotation Interface EntityPolicy


Defines entity resource policy in annotated resource role (see ResourceRole). Multiple EntityPolicy annotations may be placed on a single method. EntityPolicy annotation may present on multiple methods of the same class. Annotated method may have any name and return type.

If you need to define access for all CRUD operations then instead of listing all of them (CREATE, READ, UPDATE, DELETE) you may use the EntityPolicyAction.ALL constant.

Example:

 @ResourceRole(name = "My Role", code = "myRole")
 public interface MyRole {

     @EntityPolicy(entityClass = Order.class,
         actions = {EntityPolicyAction.CREATE, EntityPolicyAction.READ})
     @EntityPolicy(entityClass = Customer.class,
         actions = EntityPolicyAction.ALL)
     void entities();
 }
 
See Also:
  • Element Details

    • entityClass

      Class<?> entityClass
      Default:
      io.jmix.security.role.annotation.NullEntity.class
    • entityName

      String entityName
      Default:
      ""