org.keycloak.models

## Interface RoleMapperModel

- All Known Subinterfaces:
    CachedUserModel, CachedUserModel.Streams, GroupModel, GroupModel.Streams, RoleMapperModel.Streams, UserModel, UserModel.Streams
  All Known Implementing Classes:
    AbstractGroupModel, AbstractUserAdapter, AbstractUserAdapter.Streams, AbstractUserAdapterFederatedStorage, AbstractUserAdapterFederatedStorage.Streams, AbstractUserModel, GroupAdapter, GroupAdapter, GroupLDAPStorageMapper.LDAPGroupMappingsUserDelegate, InMemoryUserAdapter, LDAPWritesOnlyUserModelDelegate, MapGroupAdapter, MapUserAdapter, MSADLDSUserAccountControlStorageMapper.MSADUserModelDelegate, MSADUserAccountControlStorageMapper.MSADUserModelDelegate, ReadOnlyKerberosUserModelDelegate, ReadonlyLDAPUserModelDelegate, ReadonlySSSDUserModelDelegate, ReadOnlyUserModelDelegate, RoleLDAPStorageMapper.LDAPRoleMappingsUserDelegate, TxAwareLDAPUserModelDelegate, UpdateOnlyChangeUserModelDelegate, UserAdapter, UserAdapter, UserModelDefaultMethods, UserModelDefaultMethods.Streams, UserModelDelegate

      public interface RoleMapperModel

  Version:
    $Revision: 1 $
  Author:
    Bill Burke

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Interface and Description
    --- | ---
    `static interface` | `RoleMapperModel.Streams` The `RoleMapperModel.Streams` interface makes all collection-based methods in `RoleMapperModel` default by providing implementations that delegate to the `Stream`-based variants instead of the other way around.

  - ### Method Summary

    All Methods Instance Methods Abstract Methods Default Methods Deprecated Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `deleteRoleMapping(RoleModel role)` Removes the given role mapping from this object.
    `Set<RoleModel>` | `getClientRoleMappings(ClientModel app)` Deprecated. Use `getClientRoleMappingsStream(ClientModel)` getClientRoleMappingsStream} instead.
    `default Stream<RoleModel>` | `getClientRoleMappingsStream(ClientModel app)` Returns stream of client roles that are directly set to this object for the given client.
    `Set<RoleModel>` | `getRealmRoleMappings()` Deprecated. Use `getRealmRoleMappingsStream()` getRealmRoleMappingsStream} instead.
    `default Stream<RoleModel>` | `getRealmRoleMappingsStream()` Returns stream of realm roles that are directly set to this object.
    `Set<RoleModel>` | `getRoleMappings()` Deprecated. Use `getRoleMappingsStream()` getRoleMappingsStream} instead.
    `default Stream<RoleModel>` | `getRoleMappingsStream()` Returns stream of all role (both realm all client) that are directly set to this object.
    `void` | `grantRole(RoleModel role)` Grants the given role to this object.
    `boolean` | `hasRole(RoleModel role)` Returns `true` if this object is directly or indirectly assigned the given role, `false` otherwise.

- - ### Method Detail

    - #### getRealmRoleMappings

          @Deprecated
          Set<RoleModel> getRealmRoleMappings()

      Deprecated. Use `getRealmRoleMappingsStream()` getRealmRoleMappingsStream} instead.
      Returns set of realm roles that are directly set to this object.
      Returns:
        see description

    - #### getRealmRoleMappingsStream

          default Stream<RoleModel> getRealmRoleMappingsStream()

      Returns stream of realm roles that are directly set to this object.
      Returns:
        stream of `RoleModel`

    - #### getClientRoleMappings

          @Deprecated
          Set<RoleModel> getClientRoleMappings(ClientModel app)

      Deprecated. Use `getClientRoleMappingsStream(ClientModel)` getClientRoleMappingsStream} instead.
      Returns set of client roles that are directly set to this object for the given client.
      Parameters:
        `app` - Client to get the roles for
      Returns:
        see description

    - #### getClientRoleMappingsStream

          default Stream<RoleModel> getClientRoleMappingsStream(ClientModel app)

      Returns stream of client roles that are directly set to this object for the given client.
      Parameters:
        `app` - Client to get the roles for
      Returns:
        stream of `RoleModel`

    - #### hasRole

          boolean hasRole(RoleModel role)

      Returns `true` if this object is directly or indirectly assigned the given role, `false` otherwise.

      For example, `true` is returned for hasRole(R) if:

      - R is directly assigned to this object
      - R is not assigned to this object but this object belongs to a group G which is assigned the role R
      - R is not assigned to this object but this object belongs to a group G, and G belongs to group H which is assigned the role R
      Parameters:
        `role` -
      Returns:
        see description

    - #### grantRole

          void grantRole(RoleModel role)

      Grants the given role to this object.
      Parameters:
        `role` -

    - #### getRoleMappings

          @Deprecated
          Set<RoleModel> getRoleMappings()

      Deprecated. Use `getRoleMappingsStream()` getRoleMappingsStream} instead.
      Returns set of all role (both realm all client) that are directly set to this object.
      Returns:

    - #### getRoleMappingsStream

          default Stream<RoleModel> getRoleMappingsStream()

      Returns stream of all role (both realm all client) that are directly set to this object.
      Returns:
        stream of `RoleModel`

    - #### deleteRoleMapping

          void deleteRoleMapping(RoleModel role)

      Removes the given role mapping from this object.
      Parameters:
        `role` - Role to remove

Copyright © 2020 JBoss by Red Hat. All rights reserved.