Class DefaultEvaluation
- java.lang.Object
-
- org.keycloak.authorization.policy.evaluation.DefaultEvaluation
-
- All Implemented Interfaces:
Evaluation
public class DefaultEvaluation extends Object implements Evaluation
- Author:
- Pedro Igor
-
-
Constructor Summary
Constructors Constructor Description DefaultEvaluation(ResourcePermission permission, EvaluationContext executionContext, Decision decision, AuthorizationProvider authorizationProvider)
DefaultEvaluation(ResourcePermission permission, EvaluationContext executionContext, Policy parentPolicy, Decision decision, AuthorizationProvider authorizationProvider, Map<Policy,Map<Object,Decision.Effect>> decisionCache)
DefaultEvaluation(ResourcePermission permission, EvaluationContext executionContext, Policy parentPolicy, Policy policy, Decision decision, AuthorizationProvider authorizationProvider, Map<Policy,Map<Object,Decision.Effect>> decisionCache)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
deny()
Denies the requested permission.void
denyIfNoEffect()
Denies the requested permission if a decision was not made yet.AuthorizationProvider
getAuthorizationProvider()
EvaluationContext
getContext()
Returns theEvaluationContext
.Map<Policy,Map<Object,Decision.Effect>>
getDecisionCache()
Decision.Effect
getEffect()
Policy
getParentPolicy()
ResourcePermission
getPermission()
Returns theResourcePermission
to be evaluated.Policy
getPolicy()
Returns thePolicy
.Realm
getRealm()
Returns aRealm
that can be used by policies to query information.void
grant()
Grants the requested permission to the caller.void
setEffect(Decision.Effect effect)
void
setPolicy(Policy policy)
-
-
-
Constructor Detail
-
DefaultEvaluation
public DefaultEvaluation(ResourcePermission permission, EvaluationContext executionContext, Policy parentPolicy, Decision decision, AuthorizationProvider authorizationProvider, Map<Policy,Map<Object,Decision.Effect>> decisionCache)
-
DefaultEvaluation
public DefaultEvaluation(ResourcePermission permission, EvaluationContext executionContext, Decision decision, AuthorizationProvider authorizationProvider)
-
DefaultEvaluation
public DefaultEvaluation(ResourcePermission permission, EvaluationContext executionContext, Policy parentPolicy, Policy policy, Decision decision, AuthorizationProvider authorizationProvider, Map<Policy,Map<Object,Decision.Effect>> decisionCache)
-
-
Method Detail
-
getPermission
public ResourcePermission getPermission()
Description copied from interface:Evaluation
Returns theResourcePermission
to be evaluated.- Specified by:
getPermission
in interfaceEvaluation
- Returns:
- the permission to be evaluated
-
getContext
public EvaluationContext getContext()
Description copied from interface:Evaluation
Returns theEvaluationContext
. Which provides access to the whole evaluation runtime context.- Specified by:
getContext
in interfaceEvaluation
- Returns:
- the evaluation context
-
grant
public void grant()
Description copied from interface:Evaluation
Grants the requested permission to the caller.- Specified by:
grant
in interfaceEvaluation
-
deny
public void deny()
Description copied from interface:Evaluation
Denies the requested permission.- Specified by:
deny
in interfaceEvaluation
-
getPolicy
public Policy getPolicy()
Description copied from interface:Evaluation
Returns thePolicy
. being evaluated.- Specified by:
getPolicy
in interfaceEvaluation
- Returns:
- the evaluation context
-
getRealm
public Realm getRealm()
Description copied from interface:Evaluation
Returns aRealm
that can be used by policies to query information.- Specified by:
getRealm
in interfaceEvaluation
- Returns:
- a
Realm
instance
-
getAuthorizationProvider
public AuthorizationProvider getAuthorizationProvider()
- Specified by:
getAuthorizationProvider
in interfaceEvaluation
-
getParentPolicy
public Policy getParentPolicy()
-
getEffect
public Decision.Effect getEffect()
-
getDecisionCache
public Map<Policy,Map<Object,Decision.Effect>> getDecisionCache()
-
denyIfNoEffect
public void denyIfNoEffect()
Description copied from interface:Evaluation
Denies the requested permission if a decision was not made yet.- Specified by:
denyIfNoEffect
in interfaceEvaluation
-
setPolicy
public void setPolicy(Policy policy)
-
setEffect
public void setEffect(Decision.Effect effect)
-
-