Return-Path: X-Original-To: apmail-jackrabbit-users-archive@minotaur.apache.org Delivered-To: apmail-jackrabbit-users-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 23E6C67EE for ; Tue, 12 Jul 2011 17:00:41 +0000 (UTC) Received: (qmail 85288 invoked by uid 500); 12 Jul 2011 17:00:40 -0000 Delivered-To: apmail-jackrabbit-users-archive@jackrabbit.apache.org Received: (qmail 85139 invoked by uid 500); 12 Jul 2011 17:00:39 -0000 Mailing-List: contact users-help@jackrabbit.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: users@jackrabbit.apache.org Delivered-To: mailing list users@jackrabbit.apache.org Delivered-To: moderator for users@jackrabbit.apache.org Received: (qmail 60527 invoked by uid 99); 12 Jul 2011 16:51:20 -0000 X-ASF-Spam-Status: No, hits=2.0 required=5.0 tests=FREEMAIL_FROM,SPF_NEUTRAL,T_TO_NO_BRKTS_FREEMAIL,URI_HEX X-Spam-Check-By: apache.org Received-SPF: neutral (athena.apache.org: local policy) Date: Tue, 12 Jul 2011 09:50:54 -0700 (PDT) From: jrebillat To: users@jackrabbit.apache.org Message-ID: <1310489454494-3662853.post@n4.nabble.com> Subject: Setting twice policies on a node ? MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit 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.