Merge remote-tracking branch 'remotes/origin/feature/RM-6171_ViewClassifyAction' into feature/RM-2053_ClassificationCapability_UI_tests

This commit is contained in:
cagache
2018-04-04 17:19:10 +03:00
3 changed files with 36 additions and 0 deletions

View File

@@ -151,4 +151,12 @@ public interface CapabilityService
* @param group The group which should be removed
*/
void removeGroup(Group group);
/**
* Check if the current user has the given capability.
*
* @param capabilityName
* @return
*/
boolean hasCapability(NodeRef nodeRef, String capabilityName);
}

View File

@@ -282,4 +282,24 @@ public class CapabilityServiceImpl implements CapabilityService
groups.remove(group.getId());
}
/**
* @see org.alfresco.module.org_alfresco_module_rm.capability.CapabilityService#hasCapability(org.alfresco.service.cmr.repository.NodeRef, java.lang.String)
*/
@Override
public boolean hasCapability(NodeRef nodeRef, String capabilityName)
{
Capability capability = getCapability(capabilityName);
if (capability != null)
{
AccessStatus accessStatus = getCapabilityAccessState(nodeRef, capabilityName);
if (accessStatus.equals(AccessStatus.ALLOWED))
{
return true;
}
}
return false;
}
}

View File

@@ -154,6 +154,14 @@ public class JSONConversionComponent extends org.alfresco.repo.jscript.app.JS
this.capabilityService = capabilityService;
}
/**
* @return the nodeService
*/
protected CapabilityService getCapabilityService()
{
return this.capabilityService;
}
/**
* @param dictionaryService dictionary service
*/