public class DefaultIdentityManager extends Object implements IdentityManager
Manager that provides user and group related information.
Constructor and Description |
---|
DefaultIdentityManager(UserManager userManager,
OneCurrentUserService currentUserService,
org.springframework.context.MessageSource messageSource) |
Modifier and Type | Method and Description |
---|---|
String |
getCurrentSystemAdminUserId()
Returns current tenant administrator user ID
|
String |
getSessionUserName()
Returns the display name of the current session user.
|
List<String> |
getUsersOfGroup(String groupId)
Returns all users for the given group id.
|
List<String> |
getUsersOfGroups(Collection<String> groupIds)
Returns all users for the given group ids.
|
boolean |
isUserInAllGroups(String userId,
Collection<String> groupIds)
Checks if the user with the given id is a member of all groups the collection.
|
boolean |
isUserInGroup(String userId,
String groupId)
Checks if the given user is a member of the group with the given id.
|
boolean |
isUserInGroups(String userId,
Collection<String> groupIds)
Checks if the user with the given id is a member of at least one group in the collection.
|
public DefaultIdentityManager(UserManager userManager, OneCurrentUserService currentUserService, org.springframework.context.MessageSource messageSource)
public List<String> getUsersOfGroup(String groupId)
IdentityManager
Returns all users for the given group id.
getUsersOfGroup
in interface IdentityManager
groupId
- the id of the grouppublic List<String> getUsersOfGroups(Collection<String> groupIds)
IdentityManager
Returns all users for the given group ids.
getUsersOfGroups
in interface IdentityManager
groupIds
- the ids of the groupspublic boolean isUserInGroup(String userId, String groupId)
IdentityManager
Checks if the given user is a member of the group with the given id.
isUserInGroup
in interface IdentityManager
userId
- the user id, not nullgroupId
- the group id, not nullpublic boolean isUserInGroups(String userId, Collection<String> groupIds)
IdentityManager
Checks if the user with the given id is a member of at least one group in the collection.
isUserInGroups
in interface IdentityManager
userId
- the user id, not nullgroupIds
- collection of group Ids, not nullpublic boolean isUserInAllGroups(String userId, Collection<String> groupIds)
IdentityManager
Checks if the user with the given id is a member of all groups the collection.
isUserInAllGroups
in interface IdentityManager
userId
- the user id, not nullgroupIds
- collection of group Ids, not nullpublic String getSessionUserName()
IdentityManager
Returns the display name of the current session user. It also adds the information if the user is impersonated by another user. Example: If the user is not impersonated it will return: "Firstname Lastname", else it will return "Firstname1 Lastname1 on behalf of Firstname2 Lastname2".
getSessionUserName
in interface IdentityManager
public String getCurrentSystemAdminUserId()
IdentityManager
Returns current tenant administrator user ID
getCurrentSystemAdminUserId
in interface IdentityManager
Copyright © 2010 - 2019 edorasware ag. All Rights Reserved.