* @param session session
* @return user manager
* @throws RepositoryException if an error occurs
*/
protected UserManagerImpl createUserManager(SessionImpl session) throws RepositoryException {
UserManagerConfig umc = getConfig().getUserManagerConfig();
Properties params = (umc == null) ? null : umc.getParameters();
// since users are stored in and retrieved from a dedicated workspace
// only the system session assigned with that workspace will get the
// system user manager (special implementation that asserts the existance
// of the admin user).
if (session == systemSession) {
return new SystemUserManager(systemSession, params);
} else {
UserManagerImpl um;
if (umc != null) {
Class<?>[] paramTypes = new Class[] { SessionImpl.class, String.class, Properties.class };
um = (UserManagerImpl) umc.getUserManager(UserManagerImpl.class, paramTypes, (SessionImpl) session, adminId, params);
// TODO: should we make sure the implementation doesn't allow
// TODO: to change the autosave behavior? since the user manager
// TODO: writes to a separate workspace this would cause troubles.
} else {
um = new UserManagerImpl(session, adminId, params);