jackrabbit-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Angela Schreiber <anch...@day.com>
Subject Re: Set the permission(read/write/all) on a node
Date Thu, 15 Oct 2009 15:06:53 GMT
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:
> 
>   <AccessManager
> class="org.apache.jackrabbit.core.security.simple.SimpleAccessManager">
>      <!--  <param name="config" value="${rep.home}/access.xml"/>       -->
>   </AccessManager>
> 
>   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
> 


Mime
View raw message