I have two users "userA" and "userB". With "userA" I create a node and i want
to grant read permission to "userB" on that node.
If i do:
AccessControlUtils.allow(folderA, "userB", new
String[]{Privilege.JCR_READ});
the command fails because is not possible to find the principal "userB" in
the current session.
Same thing happens if i try to find the principal before executing the allow
function:
Session userSession = repository.login(new SimpleCredentials("userA",
"password".toCharArray()));
Authorizable userBAuth = ((JackrabbitSession)
userSession).getUserManager().getAuthorizable("Users");
AccessControlUtils.allow(folderA, userBAuth.getPrincipal().getName(), new
String[]{Privilege.JCR_READ});
How can i do it without using the administrator account? (With admin account
everything works fine).
Marco.
--
View this message in context:
http://jackrabbit.510166.n4.nabble.com/non-administrator-user-how-to-grant-permission-on-folder-tp4663773.html
Sent from the Jackrabbit - Users mailing list archive at Nabble.com.