Package io.jmix.security.model
Class ResourcePolicy
java.lang.Object
io.jmix.security.model.ResourcePolicy
- All Implemented Interfaces:
Serializable
Describes a permission to a resource.
A resource may be a screen, entity CRUD operation, entity attribute operation, etc.
For example, a policy that allows UPDATE operation on the sample_Order entity will look as follows:
- type = "entity"
- resource = "sample_Order"
- action = "update"
- effect = "allow"
- See Also:
-
Nested Class Summary
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic ResourcePolicy.Builder
Returns policy action.Returns policy effect.Returns policy group.Returns a resource description.getType()
Returns policy type.
-
Field Details
-
DEFAULT_EFFECT
- See Also:
-
DEFAULT_ACTION
- See Also:
-
DEFAULT_POLICY_GROUP
- See Also:
-
-
Constructor Details
-
ResourcePolicy
-
-
Method Details
-
builder
-
getType
Returns policy type. Standard policies type are:- menu
- screen
- entity
- entityAttribute
- specific
They are listed in the
ResourcePolicyType
- Returns:
- policy type
-
getResource
Returns a resource description. For screen policies it a screen id, for entity - entity name, for entity attributes it is a string that contains an entity name and an attribute name separated by a dot.- Returns:
- resource
-
getAction
Returns policy action. The action is an operation that policy allows or denies.- Returns:
- policy action
-
getEffect
Returns policy effect. Usually it is "allow" or "deny". The constant values are in theResourcePolicyEffect
class- Returns:
- policy effect
-
getPolicyGroup
Returns policy group. For annotated roles policy group is typically a name of the method in the role interface- Returns:
- policy group
-
getCustomProperties
-