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
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.keycloak.models.UserModel
UserModel.RequiredAction, UserModel.UserPreRemovedEvent, 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
ConstructorDescriptionLDAPRoleMappingsUserDelegate
(RealmModel realm, UserModel user, LDAPObject ldapUser, RoleContainerModel targetRoleContainer) -
Method Summary
Modifier and TypeMethodDescriptionvoid
deleteRoleMapping
(RoleModel role) Removes the given role mapping from this object.Returns stream of client roles that are directly set to this object for the given client.Returns stream of realm roles that are directly set to this object.Returns stream of all role (both realm all client) that are directly set to this object.void
Grants the given role to this object.boolean
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, isFederated, joinGroup
-
Constructor Details
-
LDAPRoleMappingsUserDelegate
public LDAPRoleMappingsUserDelegate(RealmModel realm, UserModel user, LDAPObject ldapUser, RoleContainerModel targetRoleContainer)
-
-
Method Details
-
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
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
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:
-
grantRole
Description copied from interface:RoleMapperModel
Grants the given role to this object.- Specified by:
grantRole
in interfaceRoleMapperModel
- Overrides:
grantRole
in classUserModelDelegate
-
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
.
-
getLDAPRoleMappingsConverted
-
deleteRoleMapping
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
-