Package org.keycloak.models.map.group
Class MapGroupAdapter
java.lang.Object
org.keycloak.models.map.group.AbstractGroupModel<MapGroupEntity>
org.keycloak.models.map.group.MapGroupAdapter
- All Implemented Interfaces:
GroupModel
,RoleMapperModel
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.keycloak.models.GroupModel
GroupModel.GroupPathChangeEvent, GroupModel.GroupRemovedEvent, GroupModel.SearchableFields
-
Field Summary
Fields inherited from class org.keycloak.models.map.group.AbstractGroupModel
entity, realm, session
Fields inherited from interface org.keycloak.models.GroupModel
COMPARE_BY_NAME
-
Constructor Summary
ConstructorDescriptionMapGroupAdapter
(KeycloakSession session, RealmModel realm, MapGroupEntity entity) -
Method Summary
Modifier and TypeMethodDescriptionvoid
addChild
(GroupModel subGroup) Automatically calls setParent() on the subGroupvoid
deleteRoleMapping
(RoleModel role) Removes the given role mapping from this object.getAttributeStream
(String name) Returns group attributes that match the given name as a stream.Returns stream of client roles that are directly set to this object for the given client.getFirstAttribute
(String name) getId()
getName()
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
hasDirectRole
(RoleModel role) Returnstrue
, if this object is directly assigned the given role.boolean
Returnstrue
if this object is directly or indirectly assigned the given role,false
otherwise.void
removeAttribute
(String name) void
removeChild
(GroupModel subGroup) Automatically calls setParent() on the subGroupvoid
setAttribute
(String name, List<String> values) void
void
setParent
(GroupModel group) You must also call addChild on the parent group, addChild on RealmModel if there is no parent groupvoid
setSingleAttribute
(String name, String value) Set single value of specified attribute.Methods inherited from class org.keycloak.models.map.group.AbstractGroupModel
equals, hashCode
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.keycloak.models.GroupModel
getSubGroupsStream
-
Constructor Details
-
MapGroupAdapter
-
-
Method Details
-
getId
-
getName
-
setName
-
setSingleAttribute
Description copied from interface:GroupModel
Set single value of specified attribute. Remove all other existing values -
setAttribute
-
removeAttribute
-
getFirstAttribute
- Returns:
- null if there is not any value of specified attribute or first value otherwise. Don't throw exception if there are more values of the attribute
-
getAttributeStream
Description copied from interface:GroupModel
Returns group attributes that match the given name as a stream.- Parameters:
name
-String
Name of the attribute to be used as a filter.- Returns:
- Stream of all attribute values or empty stream if there are not any values. Never return
null
.
-
getAttributes
-
getParent
-
getParentId
-
setParent
Description copied from interface:GroupModel
You must also call addChild on the parent group, addChild on RealmModel if there is no parent group -
addChild
Description copied from interface:GroupModel
Automatically calls setParent() on the subGroup -
removeChild
Description copied from interface:GroupModel
Automatically calls setParent() on the subGroup -
getRealmRoleMappingsStream
Description copied from interface:RoleMapperModel
Returns stream of realm roles that are directly set to this object.- 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.- Parameters:
app
-ClientModel
Client to get the roles for.- Returns:
- Stream of
RoleModel
. Never returnsnull
.
-
hasDirectRole
Description copied from interface:RoleMapperModel
Returnstrue
, if this object is directly assigned the given role.- Parameters:
role
- the role- Returns:
- see description
- See Also:
-
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
- Returns:
- see description
- See Also:
-
grantRole
Description copied from interface:RoleMapperModel
Grants the given role to this object. -
getRoleMappingsStream
Description copied from interface:RoleMapperModel
Returns stream of all role (both realm all client) that are directly set to this object.- Returns:
- Stream of
RoleModel
. Never returnsnull
.
-
deleteRoleMapping
Description copied from interface:RoleMapperModel
Removes the given role mapping from this object.- Parameters:
role
- Role to remove
-