Interface MultiTenantUserManager
- All Superinterfaces:
Serializable
- All Known Implementing Classes:
MultiTenantUserManager
,UserManagerImpl
,UserManagerWithComputedGroups
- Author:
- Benjamin Jalon
-
Method Summary
Modifier and TypeMethodDescriptionReturns true is users referential is read only (ie : LDAP) -> can not add users -> can not delete users.Returns true is groups referential is read only (ie : LDAP) -> can not add groups -> can not delete groups.createGroup
(DocumentModel groupModel, DocumentModel context) Creates a group from given model with the given context.createUser
(DocumentModel userModel, DocumentModel context) Creates user from given model into the given context document.void
deleteGroup
(String groupId, DocumentModel context) Deletes group with given id with the given context.void
deleteGroup
(DocumentModel groupModel, DocumentModel context) Deletes group represented by given model with the given context.void
deleteUser
(String userId, DocumentModel context) Deletes user with given id into the given context document.void
deleteUser
(DocumentModel userModel, DocumentModel context) Deletes user represented by given model into the given context document.getGroupIds
(DocumentModel context) Returns the list of all groups ids with the given context. if the Document Context have a directory local configuration, the service try to open the user directory with directory suffix set into the local configurationgetGroupModel
(String groupName, DocumentModel context) Return the group document model with this id concatenated with the directory local config (if not null) or null if group does not exist.getGroupsInGroup
(String parentId, DocumentModel context) Returns the list of groups that belong to this group with the given context.getPrincipal
(String username, DocumentModel context) Retrieves the principal with the given username or null if it does not exist into the given context document.getTopLevelGroups
(DocumentModel context) Returns the list of groups that are not members of other groups with the given context.getUserIds
(DocumentModel context) Returns the list of all user ids into the given context document.getUserModel
(String userName, DocumentModel context) Returns the document model representing user with given id or null if it does not exist into the given context document.String[]
getUsersForPermission
(String perm, ACP acp, DocumentModel context) For an ACP, get the list of user that has a permission into the given context.getUsersInGroup
(String groupId, DocumentModel context) Returns the list of users that belong to this group into the given contextgetUsersInGroupAndSubGroups
(String groupId, DocumentModel context) Get users from a group and its subgroups into the given contextsearchGroups
(String pattern, DocumentModel context) Search matching groups through their defined search fields into the given context document.searchGroups
(Map<String, Serializable> filter, Set<String> fulltext, DocumentModel context) Returns groups matching given criteria with the given context. if the Document Context have a directory local configuration, the service try to open the user directory with directory suffix set into the local configurationsearchGroups
(QueryBuilder queryBuilder, DocumentModel context) Returns groups matching the given query, within the given context.searchUsers
(String pattern, DocumentModel context) Returns users matching given pattern with the given context. if the Document Context have a directory local configuration, the service try to open the directory with directory suffix set into the local configurationsearchUsers
(Map<String, Serializable> filter, Set<String> fulltext, DocumentModel context) Returns users matching given criteria and with the given context. if the Document Context have a directory local configuration, the service try to open the user directory with directory suffix set into the local configurationsearchUsers
(QueryBuilder queryBuilder, DocumentModel context) Returns users matching the given query, within the given context.void
updateGroup
(DocumentModel groupModel, DocumentModel context) Updates group represented by given model with the given context.void
updateUser
(DocumentModel userModel, DocumentModel context) Updates user represented by given model into the given context document.
-
Method Details
-
getPrincipal
Retrieves the principal with the given username or null if it does not exist into the given context document. The context document must be contained into the tenantCan build principals for anonymous and virtual users as well as for users defined in the users directory.
- Since:
- 5.5
-
searchGroups
Search matching groups through their defined search fields into the given context document. The context document must be contained into the tenant.- Since:
- 5.5
-
searchGroups
Returns groups matching the given query, within the given context.- Parameters:
queryBuilder
- the query to use, including limit, offset, ordering and countTotalcontext
- the context for the tenant, ornull
- Since:
- 10.3
-
getUserIds
Returns the list of all user ids into the given context document. The context document must be contained into the tenant.- Since:
- 5.5
-
createUser
DocumentModel createUser(DocumentModel userModel, DocumentModel context) throws UserAlreadyExistsException Creates user from given model into the given context document. The context document must be contained into the tenant.- Throws:
UserAlreadyExistsException
- Since:
- 5.5
-
updateUser
Updates user represented by given model into the given context document. The context document must be contained into the tenant.- Since:
- 5.5
-
deleteUser
Deletes user represented by given model into the given context document. The context document must be contained into the tenant.- Since:
- 5.5
-
deleteUser
Deletes user with given id into the given context document. The context document must be contained into the tenant.- Since:
- 5.5
-
getUserModel
Returns the document model representing user with given id or null if it does not exist into the given context document. The context document must be contained into the tenant.- Since:
- 5.5
-
searchUsers
Returns users matching given pattern with the given context. if the Document Context have a directory local configuration, the service try to open the directory with directory suffix set into the local configurationPattern is used to fill a filter and fulltext map according to users search fields configuration. Search is performed on each of these fields (OR).
- Since:
- 5.5
-
searchUsers
Returns users matching the given query, within the given context.- Parameters:
queryBuilder
- the query to use, including limit, offset, ordering and countTotalcontext
- the context for the tenant, ornull
- Since:
- 10.3
-
searchUsers
DocumentModelList searchUsers(Map<String, Serializable> filter, Set<String> fulltext, DocumentModel context) Returns users matching given criteria and with the given context. if the Document Context have a directory local configuration, the service try to open the user directory with directory suffix set into the local configuration- Parameters:
filter
- filter with field names as keysfulltext
- field names used for fulltext match- Since:
- 5.5
-
getGroupIds
Returns the list of all groups ids with the given context. if the Document Context have a directory local configuration, the service try to open the user directory with directory suffix set into the local configuration- Since:
- 5.5
-
searchGroups
DocumentModelList searchGroups(Map<String, Serializable> filter, Set<String> fulltext, DocumentModel context) Returns groups matching given criteria with the given context. if the Document Context have a directory local configuration, the service try to open the user directory with directory suffix set into the local configuration- Parameters:
filter
- filter with field names as keysfulltext
- field names used for fulltext match- Since:
- 5.5
-
createGroup
DocumentModel createGroup(DocumentModel groupModel, DocumentModel context) throws GroupAlreadyExistsException Creates a group from given model with the given context. If the Document Context have a directory local configuration, the service will append at the end of the groupname the directory suffix set into the local configuration of the context document.- Returns:
- the created group model
- Throws:
GroupAlreadyExistsException
- Since:
- 5.5
-
updateGroup
Updates group represented by given model with the given context. If the Document Context have a directory local configuration, the service will append at the end of the groupname the directory suffix set into the local configuration of the context document.- Since:
- 5.5
-
deleteGroup
Deletes group represented by given model with the given context. If the Document Context have a directory local configuration, the service will append at the end of the groupname the directory suffix set into the local configuration of the context document.- Since:
- 5.5
-
deleteGroup
Deletes group with given id with the given context. If the Document Context have a directory local configuration, the service will append at the end of the groupname the directory suffix set into the local configuration of the context document.- Since:
- 5.5
-
getGroupModel
Return the group document model with this id concatenated with the directory local config (if not null) or null if group does not exist.- Parameters:
groupName
- the group identifier- Since:
- 5.5
-
getGroupsInGroup
Returns the list of groups that belong to this group with the given context. If the Document Context have a directory local configuration, the service will append at the end of the groupname the directory suffix set into the local configuration of the context document.- Parameters:
parentId
- the name of the parent group.- Since:
- 5.5
-
getTopLevelGroups
Returns the list of groups that are not members of other groups with the given context.- Since:
- 5.5
-
getUsersInGroup
Returns the list of users that belong to this group into the given context- Parameters:
groupId
- ID of the group- Since:
- 5.5
-
getUsersInGroupAndSubGroups
Get users from a group and its subgroups into the given context- Parameters:
groupId
- ID of the group- Since:
- 5.5
-
areGroupsReadOnly
Boolean areGroupsReadOnly()Returns true is users referential is read only (ie : LDAP) -> can not add users -> can not delete users.- Since:
- 5.5
-
areUsersReadOnly
Boolean areUsersReadOnly()Returns true is groups referential is read only (ie : LDAP) -> can not add groups -> can not delete groups. -
getUsersForPermission
For an ACP, get the list of user that has a permission into the given context. This method should be use with care as it can cause performance issues while getting the list of users.- Parameters:
perm
- the permissionacp
- The access control policy of the document- Returns:
- the list of user ids
- Since:
- 5.5
-