use of org.alfresco.module.org_alfresco_module_rm.capability.CapabilityService in project records-management by Alfresco.
the class ScriptRecordsManagmentNode method hasCapability.
public boolean hasCapability(String capabilityName) {
boolean result = false;
CapabilityService capabilityService = (CapabilityService) rmServices.getCapabilityService();
Capability capability = capabilityService.getCapability(capabilityName);
if (capability != null) {
Map<Capability, AccessStatus> map = capabilityService.getCapabilitiesAccessState(nodeRef, Collections.singletonList(capabilityName));
if (map.containsKey(capability)) {
AccessStatus accessStatus = map.get(capability);
if (!accessStatus.equals(AccessStatus.DENIED)) {
result = true;
}
}
}
return result;
}
Aggregations