jiveforums | 29 Aug 01:00

Differnce between Workspaces and Folder when blockin inherited rights?

Hi,

I am trying to block the inherited rights of a few document types upon creation. I created Eventlisteners
for this purpose that set up the rights.

One document type extends folder, one extends workspace.

The following method should block the inherited rights:

private void setupRights(DocumentModel doc, CoreSession documentManager) {
		
		ACP myACP = doc.getACP();
		
		ACL[] myACLs = myACP.getACLs();
		
		for( ACL myACL : myACLs ) {
			myACL.clear();
			myACP.removeACL(myACL.getName());
		}

		// Automatically creates a local ACL
		ACL newACL = new ACLImpl();
		
		newACL.add(new ACE("administrators","Everything", true));
		newACL.add(new ACE("Administrator","Everything", true));
	
		newACL.add(new ACE(SecurityConstants.EVERYONE, SecurityConstants.EVERYTHING, false));	
		
		
		myACP.addACL(newACL);
		
		try {
			documentManager.setACP(doc.getRef(), myACP, true);
			documentManager.save();
		} catch( ClientException e ) {
			log.info(e.toString());
		}
	}

This works for the folder, however it does not for the workspace...

Does anyone know why? Is there an error in the code or is there another way to block the inherited rights for
workspace datatypes?

So long

Edited by: lo on 28.08.2008 23:04

Gmane