Package org.keycloak.models
Interface Permissions
- All Known Implementing Classes:
DefaultPermissions
public interface Permissions
A permissions evaluator that can be used to check if the current user has permissions to perform an action on realm resources.
-
Method Summary
Modifier and TypeMethodDescriptionbooleanhasPermission(String resourceType, String scope) Returnstrueif the current user has permissions to perform an action on realm resources with the givenresourceTypeand with the givenscope.booleanhasPermission(Model model, String resourceType, String scope) Returnstrueif the current user has permissions to perform an action on a realm resource type with the given scopebooleanisAdminGroup(GroupModel group) Returnstrueif the given group has any admin role assigned, either directly, via parent groups, or via composite roles.booleanisAdminUser(UserModel user) Returnstrueif the given user has any admin role assigned, either directly, via group membership, or via composite roles.
-
Method Details
-
hasPermission
Returnstrueif the current user has permissions to perform an action on realm resources with the givenresourceTypeand with the givenscope.- Parameters:
resourceType- the realm resource typescope- the scope- Returns:
trueif the current user has permissions to perform an action on a realm resource type with the given scope,falseotherwise
-
hasPermission
Returnstrueif the current user has permissions to perform an action on a realm resource type with the given scope- Parameters:
resourceType- the realm resource typescope- the scope- Returns:
trueif the current user has permissions to perform an action on a realm resource type with the given scope,falseotherwise
-
isAdminUser
Returnstrueif the given user has any admin role assigned, either directly, via group membership, or via composite roles.- Parameters:
user- the user to check- Returns:
trueif the user has any admin role,falseotherwise
-
isAdminGroup
Returnstrueif the given group has any admin role assigned, either directly, via parent groups, or via composite roles.- Parameters:
group- the group to check- Returns:
trueif the group has any admin role,falseotherwise
-