jackrabbit-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jrebillat <jean.rebil...@free.fr>
Subject Setting twice policies on a node ?
Date Tue, 12 Jul 2011 16:50:54 GMT
In a program I am working on that uses JCR a storage, I need to have security
set on some nodes.
I used to use another implementation of JCR than Jackrabbit, for historical
reasons.
Now, I want to switch to Jackrabbit 2.1 but I'm hanging on something strange
to me.

On a node, I catch the policy :


         AccessControlManager manager = session.getAccessControlManager();

         Principal principal = group.getPrincipal();

         AccessControlPolicyIterator ps = 
manager.getApplicablePolicies(path);

         AccessControlList ps0 = (AccessControlList)ps.next();

then I change it with new "privs" and save :


         ps0.addAccessControlEntry(principal, privs);

         manager.setPolicy(path, ps0);

         session.save();

What is strange to me is that, from now on - even if I close the application
and restart it - I can not get another time the control list for that
particular node. In fact, calling a second time for the same path :

         AccessControlManager manager = session.getAccessControlManager();
         Principal principal = group.getPrincipal();
         AccessControlPolicyIterator ps = 
manager.getApplicablePolicies(path);
         AccessControlList ps0 = (AccessControlList)ps.next();

will generate an error (nothing to iterate on), as if there was no
applicable policies for the given path.

What did I miss ?





--
View this message in context: http://jackrabbit.510166.n4.nabble.com/Setting-twice-policies-on-a-node-tp3662853p3662853.html
Sent from the Jackrabbit - Users mailing list archive at Nabble.com.

Mime
View raw message