jackrabbit-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From marco <pioves...@esteco.com>
Subject Group permission ignored when accessing node
Date Wed, 02 Mar 2016 12:08:28 GMT
I'm using Oak v1.3.15. I've got the same problem described in  this
<http://jackrabbit.510166.n4.nabble.com/Group-membership-is-not-honoured-td4660059.html>
 
post:
I have a group called "MyUsers" containing a user called "marco". I've
created a folder called "testfolder" with admin account and i granted read
permission to the "MyUsers" group. When I login as "marco" if i try to find
that folder i get an error saying that the folder doesn't exists. I did
check the ACLs as mentioned in the other post but the only only one i see is
the one that grants read permission to the group.

Here is what i did to grant the permission:

Session adminSession = repository.login(new SimpleCredentials("admin",
"admin".toCharArray()));
Group myUsersGroup = ((SessionImpl)
adminSession).getUserManager().getAuthorizable("MyUsers");
Authorizable marco = ((SessionImpl)
adminSession).getUserManager().getAuthorizable("marco");
myUsersGroup.addMember(marco);
adminSession.save();
Node testfolder = adminSession.getNode("/testfolder");
boolean allow = AccessControlUtils.allow(testfolder,
myUsersGroup.getPrincipal(), new String[]{Privilege.JCR_READ});
adminSession.save();
adminSession.close();

userSession = repository.login(new SimpleCredentials("marco",
"password".toCharArray()));
Node node = userSession.getNode("/testfolder"); //here the code fails
because the node is not found!!

What am I doing wrong? If i grant the read permission directly to the user
everything works fine.

Marco.





--
View this message in context: http://jackrabbit.510166.n4.nabble.com/Group-permission-ignored-when-accessing-node-tp4663764.html
Sent from the Jackrabbit - Dev mailing list archive at Nabble.com.

Mime
View raw message