Class RoleLDAPStorageMapper.LDAPRoleMappingsUserDelegate
- java.lang.Object
-
- org.keycloak.models.utils.UserModelDelegate
-
- org.keycloak.storage.ldap.mappers.membership.role.RoleLDAPStorageMapper.LDAPRoleMappingsUserDelegate
-
- All Implemented Interfaces:
RoleMapperModel,UserModel
- Enclosing class:
- RoleLDAPStorageMapper
public class RoleLDAPStorageMapper.LDAPRoleMappingsUserDelegate 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 Description LDAPRoleMappingsUserDelegate(RealmModel realm, UserModel user, LDAPObject ldapUser, RoleContainerModel targetRoleContainer)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voiddeleteRoleMapping(RoleModel role)Removes the given role mapping from this object.Stream<RoleModel>getClientRoleMappingsStream(ClientModel client)Returns stream of client roles that are directly set to this object for the given client.protected Stream<RoleModel>getLDAPRoleMappingsConverted()Stream<RoleModel>getRealmRoleMappingsStream()Returns stream of realm roles that are directly set to this object.Stream<RoleModel>getRoleMappingsStream()Returns stream of all role (both realm all client) that are directly set to this object.voidgrantRole(RoleModel role)Grants the given role to this object.booleanhasRole(RoleModel role)Returnstrueif this object is directly or indirectly assigned the given role,falseotherwise.-
Methods inherited from class org.keycloak.models.utils.UserModelDelegate
addRequiredAction, addRequiredAction, credentialManager, equals, getAttributes, getAttributeStream, getCreatedTimestamp, getDelegate, getEmail, getFederationLink, getFirstAttribute, getFirstName, getGroupsStream, getId, getLastName, getRequiredActionsStream, getServiceAccountClientLink, getUsername, hashCode, isEmailVerified, isEnabled, isMemberOf, joinGroup, leaveGroup, 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.RoleMapperModel
hasDirectRole
-
Methods inherited from interface org.keycloak.models.UserModel
getGroupsCount, getGroupsCountByNameContaining, getGroupsStream
-
-
-
-
Constructor Detail
-
LDAPRoleMappingsUserDelegate
public LDAPRoleMappingsUserDelegate(RealmModel realm, UserModel user, LDAPObject ldapUser, RoleContainerModel targetRoleContainer)
-
-
Method Detail
-
getRealmRoleMappingsStream
public Stream<RoleModel> getRealmRoleMappingsStream()
Description copied from interface:RoleMapperModelReturns stream of realm roles that are directly set to this object.- Specified by:
getRealmRoleMappingsStreamin interfaceRoleMapperModel- Overrides:
getRealmRoleMappingsStreamin classUserModelDelegate- Returns:
- Stream of
RoleModel. Never returnsnull.
-
getClientRoleMappingsStream
public Stream<RoleModel> getClientRoleMappingsStream(ClientModel client)
Description copied from interface:RoleMapperModelReturns stream of client roles that are directly set to this object for the given client.- Specified by:
getClientRoleMappingsStreamin interfaceRoleMapperModel- Overrides:
getClientRoleMappingsStreamin classUserModelDelegate- Parameters:
client-ClientModelClient to get the roles for.- Returns:
- Stream of
RoleModel. Never returnsnull.
-
hasRole
public boolean hasRole(RoleModel role)
Description copied from interface:RoleMapperModelReturnstrueif this object is directly or indirectly assigned the given role,falseotherwise.For example,
trueis returned for hasRole(R) if:- R is directly assigned to this object
- R is indirectly assigned to this object via composites
- 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:
hasRolein interfaceRoleMapperModel- Overrides:
hasRolein classUserModelDelegate- Returns:
- see description
- See Also:
if you want to check if this object is directly assigned to a role
-
grantRole
public void grantRole(RoleModel role)
Description copied from interface:RoleMapperModelGrants the given role to this object.- Specified by:
grantRolein interfaceRoleMapperModel- Overrides:
grantRolein classUserModelDelegate
-
getRoleMappingsStream
public Stream<RoleModel> getRoleMappingsStream()
Description copied from interface:RoleMapperModelReturns stream of all role (both realm all client) that are directly set to this object.- Specified by:
getRoleMappingsStreamin interfaceRoleMapperModel- Overrides:
getRoleMappingsStreamin classUserModelDelegate- Returns:
- Stream of
RoleModel. Never returnsnull.
-
deleteRoleMapping
public void deleteRoleMapping(RoleModel role)
Description copied from interface:RoleMapperModelRemoves the given role mapping from this object.- Specified by:
deleteRoleMappingin interfaceRoleMapperModel- Overrides:
deleteRoleMappingin classUserModelDelegate- Parameters:
role- Role to remove
-
-