org.keycloak.storage.ldap.mappers.membership.group

## Class GroupLDAPStorageMapper.LDAPGroupMappingsUserDelegate

- java.lang.Object
- - org.keycloak.models.utils.UserModelDelegate
  - - org.keycloak.storage.ldap.mappers.membership.group.GroupLDAPStorageMapper.LDAPGroupMappingsUserDelegate

- All Implemented Interfaces:
    RoleMapperModel, RoleMapperModel.Streams, UserModel, UserModel.Streams
  Enclosing class:
    GroupLDAPStorageMapper

      public class GroupLDAPStorageMapper.LDAPGroupMappingsUserDelegate
      extends UserModelDelegate

- - ### Nested Class Summary

    - ### Nested classes/interfaces inherited from interface org.keycloak.models.UserModel

      `UserModel.RequiredAction, UserModel.SearchableFields, UserModel.Streams, UserModel.UserRemovedEvent`

  - ### Field Summary

    - ### Fields inherited from class org.keycloak.models.utils.UserModelDelegate

      `delegate`

    - ### Fields inherited from interface org.keycloak.models.UserModel

      `COMPARE_BY_USERNAME, DISABLED_REASON, EMAIL, EMAIL_VERIFIED, ENABLED, EXACT, FIRST_NAME, GROUPS, IDP_ALIAS, IDP_USER_ID, INCLUDE_SERVICE_ACCOUNT, LAST_NAME, LOCALE, SEARCH, USERNAME`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `LDAPGroupMappingsUserDelegate(RealmModel realm, UserModel user, LDAPObject ldapUser)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `Stream<GroupModel>` | `getGroupsStream()` Obtains the groups associated with the user.
    `protected Stream<GroupModel>` | `getLDAPGroupMappingsConverted()`
    `boolean` | `hasRole(RoleModel role)` Returns `true` if this object is directly or indirectly assigned the given role, `false` otherwise.
    `boolean` | `isMemberOf(GroupModel group)`
    `void` | `joinGroup(GroupModel group)`
    `void` | `leaveGroup(GroupModel group)`

    - ### Methods inherited from class org.keycloak.models.utils.UserModelDelegate

      `addRequiredAction, addRequiredAction, deleteRoleMapping, equals, getAttributes, getAttributeStream, getClientRoleMappingsStream, getCreatedTimestamp, getDelegate, getEmail, getFederationLink, getFirstAttribute, getFirstName, getId, getLastName, getRealmRoleMappingsStream, getRequiredActionsStream, getRoleMappingsStream, getServiceAccountClientLink, getUsername, grantRole, hashCode, isEmailVerified, isEnabled, removeAttribute, removeRequiredAction, removeRequiredAction, setAttribute, setCreatedTimestamp, setEmail, setEmailVerified, setEnabled, setFederationLink, setFirstName, setLastName, setServiceAccountClientLink, setSingleAttribute, setUsername`

    - ### Methods inherited from class java.lang.Object

      `clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait`

    - ### Methods inherited from interface org.keycloak.models.UserModel.Streams

      `getAttribute, getGroups, getRequiredActions`

    - ### Methods inherited from interface org.keycloak.models.UserModel

      `getGroups, getGroups, getGroupsCount, getGroupsCountByNameContaining, getGroupsStream`

    - ### Methods inherited from interface org.keycloak.models.RoleMapperModel.Streams

      `getClientRoleMappings, getRealmRoleMappings, getRoleMappings`

- - ### Constructor Detail

    - #### LDAPGroupMappingsUserDelegate

          public LDAPGroupMappingsUserDelegate(RealmModel realm,
                                               UserModel user,
                                               LDAPObject ldapUser)

  - ### Method Detail

    - #### hasRole

          public boolean hasRole(RoleModel role)

      Description copied from interface: `RoleMapperModel`
      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
      Specified by:
        `hasRole` in interface `RoleMapperModel`
      Overrides:
        `hasRole` in class `UserModelDelegate`
      Returns:
        see description

    - #### getGroupsStream

          public Stream<GroupModel> getGroupsStream()

      Description copied from interface: `UserModel`
      Obtains the groups associated with the user.
      Specified by:
        `getGroupsStream` in interface `UserModel`
      Specified by:
        `getGroupsStream` in interface `UserModel.Streams`
      Overrides:
        `getGroupsStream` in class `UserModelDelegate`
      Returns:
        a non-null `Stream` of groups.

    - #### joinGroup

          public void joinGroup(GroupModel group)

      Specified by:
        `joinGroup` in interface `UserModel`
      Overrides:
        `joinGroup` in class `UserModelDelegate`

    - #### leaveGroup

          public void leaveGroup(GroupModel group)

      Specified by:
        `leaveGroup` in interface `UserModel`
      Overrides:
        `leaveGroup` in class `UserModelDelegate`

    - #### isMemberOf

          public boolean isMemberOf(GroupModel group)

      Specified by:
        `isMemberOf` in interface `UserModel`
      Overrides:
        `isMemberOf` in class `UserModelDelegate`

    - #### getLDAPGroupMappingsConverted

          protected Stream<GroupModel> getLDAPGroupMappingsConverted()

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