From users-return-13014-apmail-jackrabbit-users-archive=jackrabbit.apache.org@jackrabbit.apache.org Thu Oct 15 15:07:35 2009 Return-Path: Delivered-To: apmail-jackrabbit-users-archive@minotaur.apache.org Received: (qmail 35155 invoked from network); 15 Oct 2009 15:07:35 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 15 Oct 2009 15:07:35 -0000 Received: (qmail 73218 invoked by uid 500); 15 Oct 2009 15:07:34 -0000 Delivered-To: apmail-jackrabbit-users-archive@jackrabbit.apache.org Received: (qmail 73177 invoked by uid 500); 15 Oct 2009 15:07:34 -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 Received: (qmail 73162 invoked by uid 99); 15 Oct 2009 15:07:34 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 15 Oct 2009 15:07:34 +0000 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of anchela@day.com designates 207.126.148.182 as permitted sender) Received: from [207.126.148.182] (HELO eu3sys201aog002.obsmtp.com) (207.126.148.182) by apache.org (qpsmtpd/0.29) with SMTP; Thu, 15 Oct 2009 15:07:24 +0000 Received: from source ([72.14.220.155]) by eu3sys201aob002.postini.com ([207.126.154.11]) with SMTP ID DSNKStc6ldCpcXM4YY+jKeO8KXZrK2cfy9Nh@postini.com; Thu, 15 Oct 2009 15:07:04 UTC Received: by fg-out-1718.google.com with SMTP id l26so2494523fgb.7 for ; Thu, 15 Oct 2009 08:07:01 -0700 (PDT) Received: by 10.86.158.29 with SMTP id g29mr310803fge.4.1255619221636; Thu, 15 Oct 2009 08:07:01 -0700 (PDT) Received: from Angela.local (bsl-rtr.day.com [62.192.10.254]) by mx.google.com with ESMTPS id 4sm2587588fgg.18.2009.10.15.08.06.59 (version=TLSv1/SSLv3 cipher=RC4-MD5); Thu, 15 Oct 2009 08:07:00 -0700 (PDT) Message-ID: <4AD73A8D.3050202@day.com> Date: Thu, 15 Oct 2009 17:06:53 +0200 From: Angela Schreiber User-Agent: Thunderbird 2.0.0.21 (Macintosh/20090302) MIME-Version: 1.0 To: users@jackrabbit.apache.org Subject: Re: Set the permission(read/write/all) on a node References: <95accef00910142346o677c0122k95023561beda1509@mail.gmail.com> In-Reply-To: <95accef00910142346o677c0122k95023561beda1509@mail.gmail.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org hi rohit as far as i know the SimpleAccessManager doesn't support access control editing. regards angela > I have a problem regarding to set the permission(read/write/all) on a node > for a user. In my user configuration ,I > place users in different directories on a single workspace. > > The configuration for access manager in repository.xml is as follows: > > class="org.apache.jackrabbit.core.security.simple.SimpleAccessManager"> > > > > To set the policy for a user("user1") , i am using following code- > > AccessControlManager accessControlManager = > sessionImpl.getAccessControlManager(); > String restrictedArea = folderNode.getPath(); > AccessControlPolicy[] restrictedPolicies = > accessControlManager.getPolicies(restrictedArea); > JackrabbitAccessControlList restrictedPolicy =(JackrabbitAccessControlList) > restrictedPolicies.nextAccessControlPolicy(); > Privilege[] privileges = { > accessControlManager.privilegeFromName(Privilege.JCR_READ) }; > Principal p_myUser = new PrincipalImpl("user1"); > restrictedPolicy.addEntry(p_myUser, privileges, true); > accessControlManager.setPolicy(restrictedArea, restrictedPolicy); > sessionImpl.save(); > > Please tell me , How to set the permission on a node ? > > Thanks > Rohit Mittal >