Package io.jmix.security.role.annotation
Annotation Interface ExplicitResourcePolicies
Annotation must be put on a method of an interface that defines a resource role (see
ResourceRole
).
Method annotated with {code @ExplicitResourcePolicies} must be a static method should return a collection of
ResourcePolicy
.
Example:
@ResourceRole(name = "Test role", code = "testRole") public interface TestExplicitResourcePoliciesRole { @ExplicitResourcePolicies static Collection<ResourcePolicy> explicitOrderPolicies() { List<ResourcePolicy> resourcePolicies = new ArrayList<>(); ResourcePolicy policy1 = new ResourcePolicy(ResourcePolicyType.SCREEN, "sample_Order.browse"); resourcePolicies.add(policy1); ResourcePolicy policy2 = new ResourcePolicy(ResourcePolicyType.ENTITY, "sample_Order", EntityPolicyAction.READ.getId()); resourcePolicies.add(policy2); return resourcePolicies; } }