cancel
Showing results for 
Search instead for 
Did you mean: 

Inherit Parent Space Permissions

mouldy63
Champ in-the-making
Champ in-the-making
Hi,

I'm creating a new space with the following code:

ParentReference parentReference = new ParentReference(
      STORE,
      null,
      "/app:company_home/cm:riskwrite" + parentXpath,
      Constants.ASSOC_CONTAINS,
      Constants.createQNameString(Constants.NAMESPACE_CONTENT_MODEL, assocName));

NamedValue[] properties = new NamedValue[]{Utils.createNamedValue(Constants.PROP_NAME, nodeName)};
CMLCreate create = new CMLCreate("1", parentReference, null, null, null, Constants.TYPE_FOLDER, properties);
CML cml = new CML();
cml.setCreate(new CMLCreate[]{create});


This works fine, but I want the new space to NOT inherit the parent space permissions. I can't find any help on this in the wiki or forums. Can anyone help please.

Thanks.
1 REPLY 1

mouldy63
Champ in-the-making
Champ in-the-making
Found it myself in the end. These 2 lines did the trick:

Predicate p = new Predicate(new Reference[]{ref}, STORE, null);
WebServiceFactory.getAccessControlService().setInheritPermission(p, false);

where ref is a
Reference
to the new space.