How do I update or delete users on Jackrabbit?

From examples and from digging around the implementations at Jackrabbit, I found how you can create a user and set privileges. However, I'm not entirely sure what you need to do, update the user, or delete it. Do you need to remove their node in the security workspace or how does this work?

Examples and links would be much appreciated.

Thanks in advance!

+3


source to share


1 answer


I couldn't find any good links either. However, this works for me using DefaultSecurityModule and DefaultLoginModule ...

JackrabbitSession adminSession = ...

UserManager userManager = adminSession.getUserManager();
AccessControlManager accessManager = adminSession.getAccessControlManager();

Authorizable user = userManager.getAuthorizable("username");
if (user != null)
    user.remove();

      



You can call user.setProperty (string name, Value) to set custom properties. To change the password authorized for a user, you can call User.changePassword (String password).

+4


source







All Articles