Class DefaultPermissions

java.lang.Object
org.keycloak.services.DefaultPermissions
All Implemented Interfaces:
Permissions

public class DefaultPermissions extends Object implements Permissions
  • Constructor Details

  • Method Details

    • hasPermission

      public boolean hasPermission(String resourceType, String scope)
      Description copied from interface: Permissions
      Returns true if the current user has permissions to perform an action on realm resources with the given resourceType and with the given scope.
      Specified by:
      hasPermission in interface Permissions
      Parameters:
      resourceType - the realm resource type
      scope - the scope
      Returns:
      true if the current user has permissions to perform an action on a realm resource type with the given scope, false otherwise
    • hasPermission

      public boolean hasPermission(Model model, String realmResourceType, String scope)
      Description copied from interface: Permissions
      Returns true if the current user has permissions to perform an action on a realm resource type with the given scope
      Specified by:
      hasPermission in interface Permissions
      realmResourceType - the realm resource type
      scope - the scope
      Returns:
      true if the current user has permissions to perform an action on a realm resource type with the given scope, false otherwise
    • isAdminGroup

      public boolean isAdminGroup(GroupModel group)
      Description copied from interface: Permissions
      Returns true if the given group has any admin role assigned, either directly, via parent groups, or via composite roles.
      Specified by:
      isAdminGroup in interface Permissions
      Parameters:
      group - the group to check
      Returns:
      true if the group has any admin role, false otherwise
    • isAdminUser

      public boolean isAdminUser(UserModel user)
      Description copied from interface: Permissions
      Returns true if the given user has any admin role assigned, either directly, via group membership, or via composite roles.
      Specified by:
      isAdminUser in interface Permissions
      Parameters:
      user - the user to check
      Returns:
      true if the user has any admin role, false otherwise