use of org.apache.chemistry.opencmis.commons.impl.dataobjects.AccessControlListImpl in project copper-cms by PogeyanOSS.
the class CmisRequestParameter method createAddAcl.
public Acl createAddAcl(ControlParser controlParser, PostRequest request) {
List<String> principals = controlParser.getValues(QueryGetRequest.CONTROL_ADD_ACE_PRINCIPAL);
if (principals == null) {
return null;
}
List<Ace> aces = new ArrayList<Ace>();
int i = 0;
for (String principalId : principals) {
aces.add(new AccessControlEntryImpl(new AccessControlPrincipalDataImpl(principalId), controlParser.getValues(QueryGetRequest.CONTROL_ADD_ACE_PERMISSION, i)));
i++;
}
return new AccessControlListImpl(aces);
}
use of org.apache.chemistry.opencmis.commons.impl.dataobjects.AccessControlListImpl in project copper-cms by PogeyanOSS.
the class CmisRequestParameter method createRemoveAcl.
public Acl createRemoveAcl(ControlParser controlParser, PostRequest request) {
List<String> principals = controlParser.getValues(QueryGetRequest.CONTROL_REMOVE_ACE_PRINCIPAL);
if (principals == null) {
return null;
}
List<Ace> aces = new ArrayList<Ace>();
int i = 0;
for (String principalId : principals) {
aces.add(new AccessControlEntryImpl(new AccessControlPrincipalDataImpl(principalId), controlParser.getValues(QueryGetRequest.CONTROL_REMOVE_ACE_PERMISSION, i)));
i++;
}
return new AccessControlListImpl(aces);
}
use of org.apache.chemistry.opencmis.commons.impl.dataobjects.AccessControlListImpl in project iaf by ibissource.
the class FilterCmisService method applyAcl.
@Override
public Acl applyAcl(String repositoryId, String objectId, Acl aces, AclPropagation aclPropagation) {
Acl orgAcl = getAclService().getAcl(repositoryId, objectId, Boolean.FALSE, null);
Acl removeAces = null;
if (orgAcl != null && orgAcl.getAces() != null && !orgAcl.getAces().isEmpty()) {
List<Ace> directAces = new ArrayList<Ace>();
for (Ace ace : orgAcl.getAces()) {
if (ace.isDirect()) {
directAces.add(ace);
}
}
if (!directAces.isEmpty()) {
removeAces = new AccessControlListImpl(directAces);
}
}
return getAclService().applyAcl(repositoryId, objectId, aces, removeAces, aclPropagation, null);
}
Aggregations