Package org.keycloak.authorization.model
Interface Policy
- All Known Implementing Classes:
AbstractPolicyModel
,MapPolicyAdapter
,PolicyAdapter
,PolicyAdapter
public interface Policy
Represents an authorization policy and all the configuration associated with it.
- Author:
- Pedro Igor
-
Nested Class Summary
Modifier and TypeInterfaceDescriptionstatic enum
static class
-
Field Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addAssociatedPolicy
(Policy associatedPolicy) void
addResource
(Resource resource) void
Returns thePolicy
instances associated with this policy and used to evaluate authorization decisions when this policy applies.Returns aMap
holding string-based key/value pairs representing any additional configuration for this policy.Returns theDecisionStrategy
for this policy.Returns the description of this policy.getId()
Returns the unique identifier for this instance.getLogic()
Returns theLogic
for this policy.getName()
Returns the name of this policy.getOwner()
Returns theResource
instances where this policy applies.Returns theResourceServer
where this policy belongs to.Returns theScope
instances where this policy applies.getType()
Returns the type of this policy.void
void
removeAssociatedPolicy
(Policy associatedPolicy) void
removeConfig
(String name) void
removeResource
(Resource resource) void
removeScope
(Scope scope) void
Sets aMap
with string-based key/value pairs representing any additional configuration for this policy.void
setDecisionStrategy
(DecisionStrategy decisionStrategy) Sets the {DecisionStrategy} for this policy.void
setDescription
(String description) Sets the description for this policy.void
Sets the {Logic} for this policy.void
Sets an unique name to this policy.void
-
Field Details
-
CONFIG_SEPARATOR
- See Also:
-
-
Method Details
-
getId
String getId()Returns the unique identifier for this instance.- Returns:
- the unique identifier for this instance
-
getType
String getType()Returns the type of this policy.- Returns:
- the type of this policy
-
getDecisionStrategy
DecisionStrategy getDecisionStrategy()Returns theDecisionStrategy
for this policy.- Returns:
- the decision strategy defined for this policy
-
setDecisionStrategy
Sets the {DecisionStrategy} for this policy.- Parameters:
decisionStrategy
- for this policy
-
getLogic
Logic getLogic()Returns theLogic
for this policy.- Returns:
- the decision strategy defined for this policy
-
setLogic
Sets the {Logic} for this policy.- Parameters:
logic
- for this policy
-
getConfig
Returns aMap
holding string-based key/value pairs representing any additional configuration for this policy.- Returns:
- a unmodifiable map with any additional configuration defined for this policy.
-
setConfig
Sets aMap
with string-based key/value pairs representing any additional configuration for this policy.- Parameters:
config
- a map with any additional configuration for this policy.
-
removeConfig
-
putConfig
-
getName
String getName()Returns the name of this policy.- Returns:
- the name of this policy
-
setName
Sets an unique name to this policy.- Parameters:
name
- an unique name
-
getDescription
String getDescription()Returns the description of this policy.- Returns:
- a description or null of there is no description
-
setDescription
Sets the description for this policy.- Parameters:
description
- a description
-
getResourceServer
ResourceServer getResourceServer()Returns theResourceServer
where this policy belongs to.- Returns:
- a resource server
-
getAssociatedPolicies
Returns thePolicy
instances associated with this policy and used to evaluate authorization decisions when this policy applies.- Returns:
- the associated policies or an empty set if no policy is associated with this policy
-
getResources
Returns theResource
instances where this policy applies.- Returns:
- a set with all resource instances where this policy applies. Or an empty set if there is no resource associated with this policy
-
getScopes
Returns theScope
instances where this policy applies.- Returns:
- a set with all scope instances where this policy applies. Or an empty set if there is no scope associated with this policy
-
getOwner
String getOwner() -
setOwner
-
addScope
-
removeScope
-
addAssociatedPolicy
-
removeAssociatedPolicy
-
addResource
-
removeResource
-