public class UserManagerImpl extends Object implements UserManager, MultiTenantUserManager
UserManager.MatchType| Modifier and Type | Field and Description |
|---|---|
static String |
DEFAULT_ANONYMOUS_USER_ID |
static String |
GROUPCHANGED_EVENT_ID
Used by JaasCacheFlusher.
|
static String |
GROUPCREATED_EVENT_ID |
static String |
GROUPDELETED_EVENT_ID |
static String |
GROUPMODIFIED_EVENT_ID |
UserMultiTenantManagement |
multiTenantManagement |
static String |
USERCHANGED_EVENT_ID
Used by JaasCacheFlusher.
|
static String |
USERCREATED_EVENT_ID |
static String |
USERDELETED_EVENT_ID |
static String |
USERMANAGER_TOPIC |
static String |
USERMODIFIED_EVENT_ID |
static String |
VIRTUAL_FIELD_FILTER_PREFIX |
| Constructor and Description |
|---|
UserManagerImpl() |
| Modifier and Type | Method and Description |
|---|---|
Boolean |
areGroupsReadOnly()
Returns true is users referential is read only (ie : LDAP) -> can not add
users -> can not delete users.
|
Boolean |
areUsersReadOnly()
Returns true is groups referential is read only (ie : LDAP) -> can not
add groups -> can not delete groups.
|
Principal |
authenticate(String name,
String password)
Get a principal object for the given username if the username / password pair is valid, otherwise returns null.
|
boolean |
checkUsernamePassword(String username,
String password)
Check the password for the given username.
|
DocumentModel |
createGroup(DocumentModel groupModel)
Creates a group from given model
|
DocumentModel |
createGroup(DocumentModel groupModel,
DocumentModel context)
Creates a group from given model with the given context.
|
void |
createGroup(NuxeoGroup group) |
void |
createPrincipal(NuxeoPrincipal principal) |
DocumentModel |
createUser(DocumentModel userModel)
Creates user from given model.
|
DocumentModel |
createUser(DocumentModel userModel,
DocumentModel context)
Creates user from given model into the given context document.
|
void |
deleteGroup(DocumentModel groupModel)
Deletes group represented by given model.
|
void |
deleteGroup(DocumentModel groupModel,
DocumentModel context)
Deletes group represented by given model with the given context.
|
void |
deleteGroup(NuxeoGroup group) |
void |
deleteGroup(String groupId)
Deletes group with given id.
|
void |
deleteGroup(String groupId,
DocumentModel context)
Deletes group with given id with the given context.
|
void |
deletePrincipal(NuxeoPrincipal principal) |
void |
deleteUser(DocumentModel userModel)
Deletes user represented by given model.
|
void |
deleteUser(DocumentModel userModel,
DocumentModel context)
Deletes user represented by given model into the given context document.
|
void |
deleteUser(String userId)
Deletes user with given id.
|
void |
deleteUser(String userId,
DocumentModel context)
Deletes user with given id into the given context document.
|
static String |
encodeDigestAuthPassword(String username,
String realm,
String password) |
List<String> |
getAdministratorsGroups()
Returns the list of administrators groups.
|
String |
getAnonymousUserId()
Gets the anonymous user id.
|
List<NuxeoGroup> |
getAvailableGroups() |
List<NuxeoPrincipal> |
getAvailablePrincipals() |
DocumentModel |
getBareGroupModel()
Returns a bare group model.
|
DocumentModel |
getBareUserModel()
Returns a bare user model.
|
String |
getDefaultGroup() |
String |
getDigestAuthDirectory()
Gets the Digest Auth directory.
|
String |
getDigestAuthRealm()
Gets the Digest Auth realm.
|
NuxeoGroup |
getGroup(String groupName)
Returns the nuxeo group with given name or null if it does not exist.
|
String |
getGroupDirectoryName()
Gets the group directory name.
|
String |
getGroupIdField()
Returns the group directory id field.
|
List<String> |
getGroupIds()
Returns the list of all groups ids.
|
List<String> |
getGroupIds(DocumentModel context)
Returns the list of all groups ids with the given context.
|
String |
getGroupLabelField()
Returns the group label field.
|
String |
getGroupListingMode() |
String |
getGroupMembersField()
Gets the group members field.
|
DocumentModel |
getGroupModel(String groupName)
Return the group document model with this id or null if group does not
exist.
|
DocumentModel |
getGroupModel(String groupIdValue,
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.
|
String |
getGroupParentGroupsField()
Gets the group parent-groups field.
|
String |
getGroupSchemaName()
Returns the group directory schema name.
|
Set<String> |
getGroupSearchFields()
Gets the group search fields.
|
List<String> |
getGroupsInGroup(String parentId)
Returns the list of groups that belong to this group.
|
List<String> |
getGroupsInGroup(String parentId,
DocumentModel context)
Returns the list of groups that belong to this group with the given
context.
|
String |
getGroupSubGroupsField()
Gets the group sub-groups field.
|
DocumentModel |
getModelForUser(String name) |
NuxeoPrincipal |
getPrincipal(String username)
Retrieves the principal with the given username or null if it does not
exist.
|
NuxeoPrincipal |
getPrincipal(String username,
DocumentModel context)
Retrieves the principal with the given username or null if it does not
exist into the given context document.
|
List<String> |
getTopLevelGroups()
Returns the list of groups that are not members of other groups.
|
List<String> |
getTopLevelGroups(DocumentModel context)
Returns the list of groups that are not members of other groups with the
given context.
|
String |
getUserDirectoryName()
Gets the user directory name.
|
String |
getUserEmailField()
Gets the user email field.
|
String |
getUserIdField()
Returns the user directory id field.
|
List<String> |
getUserIds()
Returns the list of all user ids.
|
List<String> |
getUserIds(DocumentModel context)
Returns the list of all user ids into the given context document.
|
String |
getUserListingMode() |
DocumentModel |
getUserModel(String userName)
Returns the document model representing user with given id or null if it
does not exist.
|
DocumentModel |
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.
|
Pattern |
getUserPasswordPattern() |
String |
getUserSchemaName()
Returns the user directory schema name.
|
Set<String> |
getUserSearchFields()
Gets the user search fields, the fields to use when a principal search is
done.
|
String[] |
getUsersForPermission(String perm,
ACP acp)
For an ACP, get the list of user that has a permission.
|
String[] |
getUsersForPermission(String perm,
ACP acp,
DocumentModel context)
For an ACP, get the list of user that has a permission into the given
context.
|
List<String> |
getUsersInGroup(String groupId)
Returns the list of users that belong to this group.
|
List<String> |
getUsersInGroup(String groupId,
DocumentModel context)
Returns the list of users that belong to this group into the given
context
|
List<String> |
getUsersInGroupAndSubGroups(String groupId)
Get users from a group and its subgroups.
|
List<String> |
getUsersInGroupAndSubGroups(String groupId,
DocumentModel context)
Get users from a group and its subgroups into the given context
|
String |
getUserSortField() |
List<NuxeoPrincipal> |
searchByMap(Map<String,Serializable> filter,
Set<String> pattern) |
DocumentModelList |
searchGroups(Map<String,Serializable> filter,
Set<String> fulltext)
Returns groups matching given criteria.
|
DocumentModelList |
searchGroups(Map<String,Serializable> filter,
Set<String> fulltext,
DocumentModel context)
Returns groups matching given criteria with the given context.
|
DocumentModelList |
searchGroups(String pattern)
Search matching groups through their defined search fields
|
DocumentModelList |
searchGroups(String pattern,
DocumentModel context)
Search matching groups through their defined search fields into the given
context document.
|
List<NuxeoPrincipal> |
searchPrincipals(String pattern) |
DocumentModelList |
searchUsers(Map<String,Serializable> filter,
Set<String> fulltext)
Returns users matching given criteria.
|
DocumentModelList |
searchUsers(Map<String,Serializable> filter,
Set<String> fulltext,
DocumentModel context)
Returns users matching given criteria and with the given context.
|
DocumentModelList |
searchUsers(Map<String,Serializable> filter,
Set<String> fulltext,
Map<String,String> orderBy,
DocumentModel context)
MULTI-TENANT-IMPLEMENTATION
|
DocumentModelList |
searchUsers(String pattern)
Returns users matching given pattern
|
DocumentModelList |
searchUsers(String pattern,
DocumentModel context)
Returns users matching given pattern with the given context.
|
void |
setConfiguration(UserManagerDescriptor descriptor)
Sets the given configuration on the service.
|
void |
updateGroup(DocumentModel groupModel)
Updates group represented by given model.
|
void |
updateGroup(DocumentModel groupModel,
DocumentModel context)
Updates group represented by given model with the given context.
|
void |
updateGroup(NuxeoGroup group) |
void |
updatePrincipal(NuxeoPrincipal principal) |
void |
updateUser(DocumentModel userModel)
Updates user represented by given model.
|
void |
updateUser(DocumentModel userModel,
DocumentModel context)
Updates user represented by given model into the given context document.
|
boolean |
validatePassword(String password) |
public static final String USERMANAGER_TOPIC
public static final String USERCHANGED_EVENT_ID
public static final String USERCREATED_EVENT_ID
public static final String USERDELETED_EVENT_ID
public static final String USERMODIFIED_EVENT_ID
public static final String GROUPCHANGED_EVENT_ID
public static final String GROUPCREATED_EVENT_ID
public static final String GROUPDELETED_EVENT_ID
public static final String GROUPMODIFIED_EVENT_ID
public static final String DEFAULT_ANONYMOUS_USER_ID
public static final String VIRTUAL_FIELD_FILTER_PREFIX
public UserMultiTenantManagement multiTenantManagement
public void setConfiguration(UserManagerDescriptor descriptor) throws ClientException
UserManagersetConfiguration in interface UserManagerdescriptor - the descriptor as parsed from xml, merged from the
previous one if it exists.ClientExceptionpublic String getUserDirectoryName()
UserManagergetUserDirectoryName in interface UserManagerpublic String getUserIdField() throws ClientException
UserManagergetUserIdField in interface UserManagerClientExceptionpublic String getUserSchemaName() throws ClientException
UserManagergetUserSchemaName in interface UserManagerClientExceptionpublic String getUserEmailField()
UserManagergetUserEmailField in interface UserManagerpublic Set<String> getUserSearchFields()
UserManagergetUserSearchFields in interface UserManagerpublic Set<String> getGroupSearchFields()
UserManagergetGroupSearchFields in interface UserManagerpublic String getGroupDirectoryName()
UserManagergetGroupDirectoryName in interface UserManagerpublic String getGroupIdField() throws ClientException
UserManagergetGroupIdField in interface UserManagerClientExceptionpublic String getGroupLabelField() throws ClientException
UserManagergetGroupLabelField in interface UserManagerClientExceptionpublic String getGroupSchemaName() throws ClientException
UserManagergetGroupSchemaName in interface UserManagerClientExceptionpublic String getGroupMembersField()
UserManagergetGroupMembersField in interface UserManagerpublic String getGroupSubGroupsField()
UserManagergetGroupSubGroupsField in interface UserManagerpublic String getGroupParentGroupsField()
UserManagergetGroupParentGroupsField in interface UserManagerpublic String getUserListingMode()
getUserListingMode in interface UserManagerpublic String getGroupListingMode()
getGroupListingMode in interface UserManagerpublic String getDefaultGroup()
getDefaultGroup in interface UserManagerpublic Pattern getUserPasswordPattern()
getUserPasswordPattern in interface UserManagerpublic String getAnonymousUserId()
UserManagergetAnonymousUserId in interface UserManagerpublic boolean checkUsernamePassword(String username, String password) throws ClientException
AuthenticatorcheckUsernamePassword in interface UserManagercheckUsernamePassword in interface Authenticatorusername - the usernamepassword - the password to checkClientExceptionpublic static String encodeDigestAuthPassword(String username, String realm, String password)
public String getDigestAuthDirectory()
UserManagergetDigestAuthDirectory in interface UserManagerpublic String getDigestAuthRealm()
UserManagergetDigestAuthRealm in interface UserManagerpublic boolean validatePassword(String password)
validatePassword in interface UserManagerpublic NuxeoPrincipal getPrincipal(String username) throws ClientException
UserManagerCan build principals for anonymous and virtual users as well as for users defined in the users directory.
getPrincipal in interface UserManagerClientExceptionpublic DocumentModel getUserModel(String userName) throws ClientException
UserManagergetUserModel in interface UserManagerClientExceptionpublic DocumentModel getBareUserModel() throws ClientException
UserManagerCan be used for user creation/search screens.
getBareUserModel in interface UserManagerClientExceptionpublic NuxeoGroup getGroup(String groupName) throws ClientException
UserManagergetGroup in interface UserManagerClientExceptionpublic DocumentModel getGroupModel(String groupName) throws ClientException
UserManagergetGroupModel in interface UserManagergroupName - the group identifierClientExceptionpublic List<String> getTopLevelGroups() throws ClientException
UserManagergetTopLevelGroups in interface UserManagerClientExceptionpublic List<String> getGroupsInGroup(String parentId) throws ClientException
UserManagergetGroupsInGroup in interface UserManagerparentId - the name of the parent group.ClientExceptionpublic List<String> getUsersInGroup(String groupId) throws ClientException
UserManagergetUsersInGroup in interface UserManagergroupId - ID of the groupClientExceptionpublic List<String> getUsersInGroupAndSubGroups(String groupId) throws ClientException
UserManagergetUsersInGroupAndSubGroups in interface UserManagergroupId - ID of the groupClientExceptionpublic List<NuxeoPrincipal> searchPrincipals(String pattern) throws ClientException
searchPrincipals in interface UserManagerClientExceptionpublic DocumentModelList searchGroups(String pattern) throws ClientException
UserManagersearchGroups in interface UserManagerClientExceptionpublic String getUserSortField()
getUserSortField in interface UserManagerpublic Boolean areGroupsReadOnly() throws ClientException
UserManagerareGroupsReadOnly in interface MultiTenantUserManagerareGroupsReadOnly in interface UserManagerClientExceptionpublic Boolean areUsersReadOnly() throws ClientException
UserManagerareUsersReadOnly in interface MultiTenantUserManagerareUsersReadOnly in interface UserManagerClientExceptionpublic DocumentModel createGroup(DocumentModel groupModel) throws ClientException
UserManagercreateGroup in interface UserManagerClientExceptionGroupAlreadyExistsExceptionpublic DocumentModel createUser(DocumentModel userModel) throws ClientException
UserManagercreateUser in interface UserManagerClientExceptionUserAlreadyExistsExceptionpublic void deleteGroup(String groupId) throws ClientException
UserManagerdeleteGroup in interface UserManagerDirectoryException - if given entry does not existClientExceptionpublic void deleteGroup(DocumentModel groupModel) throws ClientException
UserManagerdeleteGroup in interface UserManagerDirectoryException - if given entry does not existClientExceptionpublic void deleteUser(String userId) throws ClientException
UserManagerdeleteUser in interface UserManagerDirectoryException - if given entry does not existClientExceptionpublic void deleteUser(DocumentModel userModel) throws ClientException
UserManagerdeleteUser in interface UserManagerDirectoryException - if given entry does not existClientExceptionpublic List<String> getGroupIds() throws ClientException
UserManagergetGroupIds in interface UserManagerClientExceptionpublic List<String> getUserIds() throws ClientException
UserManagergetUserIds in interface UserManagerClientExceptionpublic DocumentModelList searchGroups(Map<String,Serializable> filter, Set<String> fulltext) throws ClientException
UserManagersearchGroups in interface UserManagerfilter - filter with field names as keysfulltext - field names used for fulltext matchClientExceptionpublic DocumentModelList searchUsers(String pattern) throws ClientException
UserManagerPattern is used to fill a filter and fulltext map according to users search fields configuration. Search is performed on each of these fields (OR).
searchUsers in interface UserManagerClientExceptionpublic DocumentModelList searchUsers(Map<String,Serializable> filter, Set<String> fulltext) throws ClientException
UserManagersearchUsers in interface UserManagerfilter - filter with field names as keysfulltext - field names used for fulltext matchClientExceptionpublic void updateGroup(DocumentModel groupModel) throws ClientException
UserManagerupdateGroup in interface UserManagerDirectoryException - if given entry does not existClientExceptionpublic void updateUser(DocumentModel userModel) throws ClientException
UserManagerupdateUser in interface UserManagerClientExceptionpublic DocumentModel getBareGroupModel() throws ClientException
UserManagerCan be used for group creation/search screens.
getBareGroupModel in interface UserManagerClientExceptionpublic void createGroup(NuxeoGroup group) throws ClientException
createGroup in interface UserManagerClientExceptionpublic void createPrincipal(NuxeoPrincipal principal) throws ClientException
createPrincipal in interface UserManagerClientExceptionpublic void deleteGroup(NuxeoGroup group) throws ClientException
deleteGroup in interface UserManagerClientExceptionpublic void deletePrincipal(NuxeoPrincipal principal) throws ClientException
deletePrincipal in interface UserManagerClientExceptionpublic List<NuxeoGroup> getAvailableGroups() throws ClientException
getAvailableGroups in interface UserManagerClientExceptionpublic List<NuxeoPrincipal> getAvailablePrincipals() throws ClientException
getAvailablePrincipals in interface UserManagerClientExceptionpublic DocumentModel getModelForUser(String name) throws ClientException
getModelForUser in interface UserManagerClientExceptionpublic List<NuxeoPrincipal> searchByMap(Map<String,Serializable> filter, Set<String> pattern) throws ClientException
searchByMap in interface UserManagerClientExceptionpublic void updateGroup(NuxeoGroup group) throws ClientException
updateGroup in interface UserManagerClientExceptionpublic void updatePrincipal(NuxeoPrincipal principal) throws ClientException
updatePrincipal in interface UserManagerClientExceptionpublic List<String> getAdministratorsGroups()
UserManagergetAdministratorsGroups in interface UserManagerpublic String[] getUsersForPermission(String perm, ACP acp)
UserManagergetUsersForPermission in interface UserManagerperm - the permissionacp - The access control policy of the documentpublic Principal authenticate(String name, String password) throws ClientException
AuthenticatorThis method is doing the authentication of the given username / password pair and returns the corresponding principal object if authentication succeeded otherwise returns null.
authenticate in interface AuthenticatorClientExceptionpublic DocumentModelList searchUsers(Map<String,Serializable> filter, Set<String> fulltext, Map<String,String> orderBy, DocumentModel context) throws ClientException
ClientExceptionpublic List<String> getUsersInGroup(String groupId, DocumentModel context) throws ClientException
MultiTenantUserManagergetUsersInGroup in interface MultiTenantUserManagergroupId - ID of the groupClientExceptionpublic DocumentModelList searchUsers(String pattern, DocumentModel context) throws ClientException
MultiTenantUserManagerPattern is used to fill a filter and fulltext map according to users search fields configuration. Search is performed on each of these fields (OR).
searchUsers in interface MultiTenantUserManagerClientExceptionpublic DocumentModelList searchUsers(Map<String,Serializable> filter, Set<String> fulltext, DocumentModel context) throws ClientException
MultiTenantUserManagersearchUsers in interface MultiTenantUserManagerfilter - filter with field names as keysfulltext - field names used for fulltext matchClientExceptionpublic List<String> getGroupIds(DocumentModel context) throws ClientException
MultiTenantUserManagergetGroupIds in interface MultiTenantUserManagerClientExceptionpublic DocumentModelList searchGroups(Map<String,Serializable> filter, Set<String> fulltext, DocumentModel context) throws ClientException
MultiTenantUserManagersearchGroups in interface MultiTenantUserManagerfilter - filter with field names as keysfulltext - field names used for fulltext matchClientExceptionpublic DocumentModel createGroup(DocumentModel groupModel, DocumentModel context) throws ClientException, GroupAlreadyExistsException
MultiTenantUserManagercreateGroup in interface MultiTenantUserManagerClientExceptionGroupAlreadyExistsExceptionpublic DocumentModel getGroupModel(String groupIdValue, DocumentModel context) throws ClientException
MultiTenantUserManagergetGroupModel in interface MultiTenantUserManagergroupIdValue - the group identifierClientExceptionpublic DocumentModel getUserModel(String userName, DocumentModel context) throws ClientException
MultiTenantUserManagergetUserModel in interface MultiTenantUserManagerClientExceptionpublic NuxeoPrincipal getPrincipal(String username, DocumentModel context) throws ClientException
MultiTenantUserManagerCan build principals for anonymous and virtual users as well as for users defined in the users directory.
getPrincipal in interface MultiTenantUserManagerClientExceptionpublic DocumentModelList searchGroups(String pattern, DocumentModel context) throws ClientException
MultiTenantUserManagersearchGroups in interface MultiTenantUserManagerClientExceptionpublic List<String> getUserIds(DocumentModel context) throws ClientException
MultiTenantUserManagergetUserIds in interface MultiTenantUserManagerClientExceptionpublic DocumentModel createUser(DocumentModel userModel, DocumentModel context) throws ClientException, UserAlreadyExistsException
MultiTenantUserManagercreateUser in interface MultiTenantUserManagerClientExceptionUserAlreadyExistsExceptionpublic void updateUser(DocumentModel userModel, DocumentModel context) throws ClientException
MultiTenantUserManagerupdateUser in interface MultiTenantUserManagerClientExceptionpublic void deleteUser(DocumentModel userModel, DocumentModel context) throws ClientException
MultiTenantUserManagerdeleteUser in interface MultiTenantUserManagerDirectoryException - if given entry does not existClientExceptionpublic void deleteUser(String userId, DocumentModel context) throws ClientException
MultiTenantUserManagerdeleteUser in interface MultiTenantUserManagerDirectoryException - if given entry does not existClientExceptionpublic void updateGroup(DocumentModel groupModel, DocumentModel context) throws ClientException
MultiTenantUserManagerupdateGroup in interface MultiTenantUserManagerDirectoryException - if given entry does not existClientExceptionpublic void deleteGroup(DocumentModel groupModel, DocumentModel context) throws ClientException
MultiTenantUserManagerdeleteGroup in interface MultiTenantUserManagerDirectoryException - if given entry does not existClientExceptionpublic void deleteGroup(String groupId, DocumentModel context) throws ClientException
MultiTenantUserManagerdeleteGroup in interface MultiTenantUserManagerDirectoryException - if given entry does not existClientExceptionpublic List<String> getGroupsInGroup(String parentId, DocumentModel context) throws ClientException
MultiTenantUserManagergetGroupsInGroup in interface MultiTenantUserManagerparentId - the name of the parent group.ClientExceptionpublic List<String> getTopLevelGroups(DocumentModel context) throws ClientException
MultiTenantUserManagergetTopLevelGroups in interface MultiTenantUserManagerClientExceptionpublic List<String> getUsersInGroupAndSubGroups(String groupId, DocumentModel context) throws ClientException
MultiTenantUserManagergetUsersInGroupAndSubGroups in interface MultiTenantUserManagergroupId - ID of the groupClientExceptionpublic String[] getUsersForPermission(String perm, ACP acp, DocumentModel context)
MultiTenantUserManagergetUsersForPermission in interface MultiTenantUserManagerperm - the permissionacp - The access control policy of the documentCopyright © 2013 Nuxeo SA. All Rights Reserved.