jackrabbit-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From vicent <fabio.rodrig...@alert-online.com>
Subject Re: Users privileges to create Node Types
Date Tue, 16 Apr 2013 11:08:49 GMT
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