Class GroupPolicyProvider
java.lang.Object
org.keycloak.authorization.policy.provider.group.GroupPolicyProvider
- All Implemented Interfaces:
PartialEvaluationPolicyProvider,PolicyProvider,Provider
public class GroupPolicyProvider
extends Object
implements PolicyProvider, PartialEvaluationPolicyProvider
- Author:
- Pedro Igor
-
Constructor Summary
ConstructorsConstructorDescriptionGroupPolicyProvider(BiFunction<Policy, AuthorizationProvider, GroupPolicyRepresentation> representationFunction) -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()voidevaluate(Evaluation evaluation) booleanevaluate(KeycloakSession session, Policy policy, UserModel subject) Evaluate if the givenpolicygrants access to the givensubject.getPermissions(KeycloakSession session, ResourceType resourceType, UserModel user) Returns a list ofPolicyinstances representing the permissions that apply to a givensubjectwhen partially evaluating the realm resources that can be accessed.booleanIf partial evaluation is supported for the givenpolicy.
-
Constructor Details
-
GroupPolicyProvider
public GroupPolicyProvider(BiFunction<Policy, AuthorizationProvider, GroupPolicyRepresentation> representationFunction)
-
-
Method Details
-
evaluate
- Specified by:
evaluatein interfacePolicyProvider
-
getPermissions
public Stream<Policy> getPermissions(KeycloakSession session, ResourceType resourceType, UserModel user) Description copied from interface:PartialEvaluationPolicyProviderReturns a list ofPolicyinstances representing the permissions that apply to a givensubjectwhen partially evaluating the realm resources that can be accessed.- Specified by:
getPermissionsin interfacePartialEvaluationPolicyProvider- Parameters:
session- the sessionresourceType- the type of the resourceuser- the subject- Returns:
- the permissions that apply to the given
subject
-
evaluate
Description copied from interface:PartialEvaluationPolicyProviderEvaluate if the givenpolicygrants access to the givensubject.- Specified by:
evaluatein interfacePartialEvaluationPolicyProvider- Parameters:
session- the sessionpolicy- the policysubject- the subject- Returns:
trueif access is granted. Otherwise, returnsfalse
-
supports
Description copied from interface:PartialEvaluationPolicyProviderIf partial evaluation is supported for the givenpolicy.- Specified by:
supportsin interfacePartialEvaluationPolicyProvider- Parameters:
policy- the policy- Returns:
trueif supported. Otherwise, returnsfalse
-
close
public void close()
-