RM-2160 (Update Classify Action config once users with security clearances exist)

+review RM @rwetherall @dwebster

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/modules/recordsmanagement/HEAD@104308 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Tuna Aksoy
2015-05-15 16:20:16 +00:00
parent d42c0cabdd
commit 340aa8ec6f
2 changed files with 18 additions and 1 deletions

View File

@@ -26,6 +26,7 @@ import java.util.Map;
import org.alfresco.model.ContentModel;
import org.alfresco.module.org_alfresco_module_rm.capability.CapabilityService;
import org.alfresco.module.org_alfresco_module_rm.capability.impl.ViewRecordsCapability;
import org.alfresco.module.org_alfresco_module_rm.classification.SecurityClearanceService;
import org.alfresco.module.org_alfresco_module_rm.fileplan.FilePlanComponentKind;
import org.alfresco.module.org_alfresco_module_rm.fileplan.FilePlanService;
import org.alfresco.module.org_alfresco_module_rm.model.RecordsManagementModel;
@@ -65,6 +66,7 @@ public class JSONConversionComponent extends org.alfresco.repo.jscript.app.JS
private static final String IS_RM_SITE_CREATED = "isRmSiteCreated";
private static final String IS_RECORD_CONTRIBUTOR_GROUP_ENABLED = "isRecordContributorGroupEnabled";
private static final String RECORD_CONTRIBUTOR_GROUP_NAME = "recordContributorGroupName";
private static final String HAS_CLEARANCE = "hasClearance";
/** true if record contributor group is enabled, false otherwise */
private boolean isRecordContributorsGroupEnabled = false;
@@ -87,6 +89,9 @@ public class JSONConversionComponent extends org.alfresco.repo.jscript.app.JS
/** site service */
private SiteService siteService;
/** Security clearance service */
private SecurityClearanceService securityClearanceService;
/** Indicators */
private List<BaseEvaluator> indicators = new ArrayList<BaseEvaluator>();
@@ -158,6 +163,14 @@ public class JSONConversionComponent extends org.alfresco.repo.jscript.app.JS
this.siteService = siteService;
}
/**
* @param securityClearanceService the securityClearanceService to set
*/
public void setSecurityClearanceService(SecurityClearanceService securityClearanceService)
{
this.securityClearanceService = securityClearanceService;
}
/**
* @param indicator registered indicator
*/
@@ -241,10 +254,13 @@ public class JSONConversionComponent extends org.alfresco.repo.jscript.app.JS
// Get the node reference for convenience
NodeRef nodeRef = nodeInfo.getNodeRef();
// Get the clearance information for the node
rootJSONObject.put(HAS_CLEARANCE, securityClearanceService.hasClearance(nodeRef));
if (AccessStatus.ALLOWED.equals(capabilityService.getCapabilityAccessState(nodeRef, ViewRecordsCapability.NAME)))
{
// Indicate whether the node is a RM object or not
boolean isFilePlanComponent = filePlanService.isFilePlanComponent(nodeInfo.getNodeRef());
boolean isFilePlanComponent = filePlanService.isFilePlanComponent(nodeRef);
rootJSONObject.put(IS_RM_NODE, isFilePlanComponent);
if (isFilePlanComponent)