3
votes

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

Examples and links would be very much appreciated.

Thanks in advance!

1

1 Answers

4
votes

I couldn't really 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 value) for setting custom properties. To change password cast Authorizable to User then you can call User.changePassword(String password).