jackrabbit-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Angela Schreiber <anch...@adobe.com>
Subject Re: Users privileges to create Node Types
Date Tue, 16 Apr 2013 13:16:18 GMT
hi

the only thing that looks odd is "new Principal(user)".
otherwise i don't see at a first glance why it shouldn't work
if you are using a recent version of jackrabbit...

could you create another test along with
AbstractRepositoryOperationTest#testRegisterNodeTypeWithPrivilege
and run it with your setup?

thanks
angela

On 4/16/13 1:08 PM, vicent wrote:
> Hi Angela,
> Thanks for your replay.
>
> I tried to implement the solution, but not worked or i didn't understand....
>
> i tried the following:
>
> first, i create an user:
>
> 		User user = um.createUser(userName,password);
> 		
> define privileges:
> 		
> 		AccessControlManager aMgr = session.getAccessControlManager();
> 		
> 		Privilege[] privileges=new
> Privilege[]{aMgr.privilegeFromName(Privilege.JCR_ALL)};
> 		
> set grants (for the 'null' path):
>
> 		AccessControlList acl;
> 		try {
> 			acl = (AccessControlList)
> aMgr.getApplicablePolicies(null).nextAccessControlPolicy();
> 		} catch (NoSuchElementException e) {
> 			acl = (AccessControlList) aMgr.getPolicies(null)[0];
> 		}
> 		
> 		acl.addAccessControlEntry(new PrincipalImpl(user), privileges);
> 		aMgr.setPolicy(null, acl);
> 		session.save();
> 		
> So, what i doing wrong? :S
>
> Thanks
>
>
>
> --
> View this message in context: http://jackrabbit.510166.n4.nabble.com/Users-privileges-to-create-Node-Types-tp4658252p4658266.html
> Sent from the Jackrabbit - Users mailing list archive at Nabble.com.

Mime
View raw message