mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-07-31 17:39:05 +00:00
RM-2119 Don't need to explicitly apply the aspect.
By setting the property on the node the aspect will be applied automatically if it hasn't already been applied. +review RM-45 git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/modules/recordsmanagement/HEAD@103786 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -21,19 +21,15 @@ package org.alfresco.module.org_alfresco_module_rm.classification;
|
||||
import static org.alfresco.module.org_alfresco_module_rm.classification.model.ClassifiedContentModel.ASPECT_SECURITY_CLEARANCE;
|
||||
import static org.alfresco.module.org_alfresco_module_rm.classification.model.ClassifiedContentModel.PROP_CLEARANCE_LEVEL;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import com.google.common.collect.ImmutableMap;
|
||||
import org.alfresco.module.org_alfresco_module_rm.util.ServiceBaseImpl;
|
||||
import org.alfresco.query.PagingRequest;
|
||||
import org.alfresco.query.PagingResults;
|
||||
import org.alfresco.service.cmr.repository.NodeRef;
|
||||
import org.alfresco.service.cmr.security.PersonService;
|
||||
import org.alfresco.service.cmr.security.PersonService.PersonInfo;
|
||||
import org.alfresco.service.namespace.QName;
|
||||
import org.alfresco.util.Pair;
|
||||
import org.alfresco.util.ParameterCheck;
|
||||
|
||||
@@ -120,14 +116,6 @@ public class SecurityClearanceServiceImpl extends ServiceBaseImpl implements Sec
|
||||
// LevelIdNotFound exception if not.
|
||||
classificationService.getClassificationLevelById(clearanceId);
|
||||
|
||||
if (nodeService.hasAspect(personNode, ASPECT_SECURITY_CLEARANCE))
|
||||
{
|
||||
nodeService.setProperty(personNode, PROP_CLEARANCE_LEVEL, clearanceId);
|
||||
}
|
||||
else
|
||||
{
|
||||
Map<QName, Serializable> properties = ImmutableMap.of(PROP_CLEARANCE_LEVEL, (Serializable) clearanceId);
|
||||
nodeService.addAspect(personNode, ASPECT_SECURITY_CLEARANCE, properties);
|
||||
}
|
||||
nodeService.setProperty(personNode, PROP_CLEARANCE_LEVEL, clearanceId);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user