Package io.jmix.security.role.annotation
Annotation Interface EntityPolicy
@Target(METHOD)
@Retention(RUNTIME)
@Repeatable(EntityPolicyContainer.class)
public @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:
-
Required Element Summary
Required Elements -
Optional Element Summary
Optional Elements
-
Element Details
-
actions
EntityPolicyAction[] actions
-
-