Interface Evaluation
- All Known Implementing Classes:
DefaultEvaluation,FGAPEvaluation
public interface Evaluation
An Evaluation is mainly used by PolicyProvider in order to evaluate a single
and specific ResourcePermission against the configured policies.
- Author:
- Pedro Igor
-
Method Summary
Modifier and TypeMethodDescriptionvoiddeny()Denies the requested permission.voidDenies the requested permission if a decision was not made yet.Returns theEvaluationContext.Returns the parent policy (a permission) of the policy being evaluated.Returns theResourcePermissionto be evaluated.Returns thePolicy.getRealm()Returns aRealmthat can be used by policies to query information.voidgrant()Grants the requested permission to the caller.default booleanIf the given scope should not be granted when the givendeniedPolicydenies access to a resource or a specific scope.default booleanIf the given scope should be granted when the givengrantedPolicyis granting access to a resource or a specific scope.voidsetEffect(Decision.Effect effect)
-
Method Details
-
getPermission
ResourcePermission getPermission()Returns theResourcePermissionto be evaluated.- Returns:
- the permission to be evaluated
-
getContext
EvaluationContext getContext()Returns theEvaluationContext. Which provides access to the whole evaluation runtime context.- Returns:
- the evaluation context
-
getPolicy
Policy getPolicy()Returns thePolicy. being evaluated.- Returns:
- the evaluation context
-
getRealm
Realm getRealm()Returns aRealmthat can be used by policies to query information.- Returns:
- a
Realminstance
-
getAuthorizationProvider
AuthorizationProvider getAuthorizationProvider() -
grant
void grant()Grants the requested permission to the caller. -
deny
void deny()Denies the requested permission. -
denyIfNoEffect
void denyIfNoEffect()Denies the requested permission if a decision was not made yet. -
getParentPolicy
Policy getParentPolicy()Returns the parent policy (a permission) of the policy being evaluated.- Returns:
- the parent policy
-
getEffect
Decision.Effect getEffect() -
setEffect
-
isGranted
If the given scope should be granted when the givengrantedPolicyis granting access to a resource or a specific scope.- Parameters:
grantedPolicy- the policy granting accessgrantedScope- the scope that should be granted- Returns:
trueif the scope is granted. Otherwise, returnsfalse
-
isDenied
If the given scope should not be granted when the givendeniedPolicydenies access to a resource or a specific scope.- Parameters:
deniedPolicy- the policy granting accessdeniedScope- the scope that should be granted- Returns:
trueif the scope is granted. Otherwise, returnsfalse
-