- JcrUtils.clearAccessControList(session, homePath, username);
- JcrUtils.addPrivilege(session, homePath, username, Privilege.JCR_ALL);
- }
-
- Node userProfile = UserJcrUtils.getUserProfile(session, username);
- // new user
- if (userProfile == null) {
- String personPath = generateUserPath(peopleBasePath, username);
- Node personBase;
- if (session.itemExists(personPath))// duplicate user id
- personBase = session.getNode(personPath).getParent().addNode(JcrUtils.lastPathElement(personPath));
- else
- personBase = JcrUtils.mkdirs(session, personPath);
- userProfile = personBase.addNode(ArgeoNames.ARGEO_PROFILE);
- userProfile.addMixin(ArgeoTypes.ARGEO_USER_PROFILE);
- userProfile.setProperty(ArgeoNames.ARGEO_USER_ID, username);
- // userProfile.setProperty(ArgeoNames.ARGEO_ENABLED, true);
- // userProfile.setProperty(ArgeoNames.ARGEO_ACCOUNT_NON_EXPIRED,
- // true);
- // userProfile.setProperty(ArgeoNames.ARGEO_ACCOUNT_NON_LOCKED,
- // true);
- // userProfile.setProperty(ArgeoNames.ARGEO_CREDENTIALS_NON_EXPIRED,
- // true);
- session.save();
-
- JcrUtils.clearAccessControList(session, userProfile.getPath(), username);
- JcrUtils.addPrivilege(session, userProfile.getPath(), username, Privilege.JCR_READ);
+ JcrUtils.clearAccessControList(adminSession, homePath, username);
+ JcrUtils.addPrivilege(adminSession, homePath, username, Privilege.JCR_ALL);