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 void
deleteRoleMapping(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.void
grantRole(RoleModel role)
Grants the given role to this object.boolean
hasRole(RoleModel role)
Returnstrue
if this object is directly or indirectly assigned the given role,false
otherwise.-
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:RoleMapperModel
Returns stream of realm roles that are directly set to this object.- Specified by:
getRealmRoleMappingsStream
in interfaceRoleMapperModel
- Overrides:
getRealmRoleMappingsStream
in classUserModelDelegate
- Returns:
- Stream of
RoleModel
. Never returnsnull
.
-
getClientRoleMappingsStream
public Stream<RoleModel> getClientRoleMappingsStream(ClientModel client)
Description copied from interface:RoleMapperModel
Returns stream of client roles that are directly set to this object for the given client.- Specified by:
getClientRoleMappingsStream
in interfaceRoleMapperModel
- Overrides:
getClientRoleMappingsStream
in classUserModelDelegate
- Parameters:
client
-ClientModel
Client to get the roles for.- Returns:
- Stream of
RoleModel
. Never returnsnull
.
-
hasRole
public boolean hasRole(RoleModel role)
Description copied from interface:RoleMapperModel
Returnstrue
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 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:
hasRole
in interfaceRoleMapperModel
- Overrides:
hasRole
in 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:RoleMapperModel
Grants the given role to this object.- Specified by:
grantRole
in interfaceRoleMapperModel
- Overrides:
grantRole
in classUserModelDelegate
-
getRoleMappingsStream
public Stream<RoleModel> getRoleMappingsStream()
Description copied from interface:RoleMapperModel
Returns stream of all role (both realm all client) that are directly set to this object.- Specified by:
getRoleMappingsStream
in interfaceRoleMapperModel
- Overrides:
getRoleMappingsStream
in classUserModelDelegate
- Returns:
- Stream of
RoleModel
. Never returnsnull
.
-
deleteRoleMapping
public void deleteRoleMapping(RoleModel role)
Description copied from interface:RoleMapperModel
Removes the given role mapping from this object.- Specified by:
deleteRoleMapping
in interfaceRoleMapperModel
- Overrides:
deleteRoleMapping
in classUserModelDelegate
- Parameters:
role
- Role to remove
-
-