Package org.keycloak.authorization.model
Interface Policy
- 
- All Known Implementing Classes:
- AbstractPolicyModel,- MapPolicyAdapter,- PolicyAdapter,- PolicyAdapter
 
 public interface PolicyRepresents an authorization policy and all the configuration associated with it.- Author:
- Pedro Igor
 
- 
- 
Nested Class SummaryNested Classes Modifier and Type Interface Description static classPolicy.FilterOptionstatic classPolicy.SearchableFields
 - 
Field SummaryFields Modifier and Type Field Description static StringCONFIG_SEPARATOR
 - 
Method SummaryAll Methods Instance Methods Abstract Methods Modifier and Type Method Description voidaddAssociatedPolicy(Policy associatedPolicy)voidaddResource(Resource resource)voidaddScope(Scope scope)Set<Policy>getAssociatedPolicies()Returns thePolicyinstances associated with this policy and used to evaluate authorization decisions when this policy applies.Map<String,String>getConfig()Returns aMapholding string-based key/value pairs representing any additional configuration for this policy.DecisionStrategygetDecisionStrategy()Returns theDecisionStrategyfor this policy.StringgetDescription()Returns the description of this policy.StringgetId()Returns the unique identifier for this instance.LogicgetLogic()Returns theLogicfor this policy.StringgetName()Returns the name of this policy.StringgetOwner()Set<Resource>getResources()Returns theResourceinstances where this policy applies.ResourceServergetResourceServer()Returns theResourceServerwhere this policy belongs to.Set<Scope>getScopes()Returns theScopeinstances where this policy applies.StringgetType()Returns the type of this policy.voidputConfig(String name, String value)voidremoveAssociatedPolicy(Policy associatedPolicy)voidremoveConfig(String name)voidremoveResource(Resource resource)voidremoveScope(Scope scope)voidsetConfig(Map<String,String> config)Sets aMapwith string-based key/value pairs representing any additional configuration for this policy.voidsetDecisionStrategy(DecisionStrategy decisionStrategy)Sets the {DecisionStrategy} for this policy.voidsetDescription(String description)Sets the description for this policy.voidsetLogic(Logic logic)Sets the {Logic} for this policy.voidsetName(String name)Sets an unique name to this policy.voidsetOwner(String owner)
 
- 
- 
- 
Field Detail- 
CONFIG_SEPARATORstatic final String CONFIG_SEPARATOR - See Also:
- Constant Field Values
 
 
- 
 - 
Method Detail- 
getIdString getId() Returns the unique identifier for this instance.- Returns:
- the unique identifier for this instance
 
 - 
getTypeString getType() Returns the type of this policy.- Returns:
- the type of this policy
 
 - 
getDecisionStrategyDecisionStrategy getDecisionStrategy() Returns theDecisionStrategyfor this policy.- Returns:
- the decision strategy defined for this policy
 
 - 
setDecisionStrategyvoid setDecisionStrategy(DecisionStrategy decisionStrategy) Sets the {DecisionStrategy} for this policy.- Parameters:
- decisionStrategy- for this policy
 
 - 
getLogicLogic getLogic() Returns theLogicfor this policy.- Returns:
- the decision strategy defined for this policy
 
 - 
setLogicvoid setLogic(Logic logic) Sets the {Logic} for this policy.- Parameters:
- logic- for this policy
 
 - 
getConfigMap<String,String> getConfig() Returns aMapholding string-based key/value pairs representing any additional configuration for this policy.- Returns:
- a unmodifiable map with any additional configuration defined for this policy.
 
 - 
setConfigvoid setConfig(Map<String,String> config) Sets aMapwith string-based key/value pairs representing any additional configuration for this policy.- Parameters:
- config- a map with any additional configuration for this policy.
 
 - 
removeConfigvoid removeConfig(String name) 
 - 
getNameString getName() Returns the name of this policy.- Returns:
- the name of this policy
 
 - 
setNamevoid setName(String name) Sets an unique name to this policy.- Parameters:
- name- an unique name
 
 - 
getDescriptionString getDescription() Returns the description of this policy.- Returns:
- a description or null of there is no description
 
 - 
setDescriptionvoid setDescription(String description) Sets the description for this policy.- Parameters:
- description- a description
 
 - 
getResourceServerResourceServer getResourceServer() Returns theResourceServerwhere this policy belongs to.- Returns:
- a resource server
 
 - 
getAssociatedPoliciesSet<Policy> getAssociatedPolicies() Returns thePolicyinstances 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
 
 - 
getResourcesSet<Resource> getResources() Returns theResourceinstances 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
 
 - 
getScopesSet<Scope> getScopes() Returns theScopeinstances 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
 
 - 
getOwnerString getOwner() 
 - 
setOwnervoid setOwner(String owner) 
 - 
addScopevoid addScope(Scope scope) 
 - 
removeScopevoid removeScope(Scope scope) 
 - 
addAssociatedPolicyvoid addAssociatedPolicy(Policy associatedPolicy) 
 - 
removeAssociatedPolicyvoid removeAssociatedPolicy(Policy associatedPolicy) 
 - 
addResourcevoid addResource(Resource resource) 
 - 
removeResourcevoid removeResource(Resource resource) 
 
- 
 
-