RM-2123 Ensure user has clearance to classify content.

Also add clearance check method into security profile.

+review RM-58

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/modules/recordsmanagement/HEAD@104750 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Tom Page
2015-05-22 13:20:00 +00:00
parent eafaad25ea
commit 655a8d8a5d
3 changed files with 26 additions and 3 deletions

View File

@@ -29,6 +29,7 @@ import java.util.Set;
import org.alfresco.model.ContentModel;
import org.alfresco.module.org_alfresco_module_rm.classification.ClassificationServiceException.InvalidNode;
import org.alfresco.module.org_alfresco_module_rm.classification.ClassificationServiceException.LevelIdNotFound;
import org.alfresco.module.org_alfresco_module_rm.classification.model.ClassifiedContentModel;
import org.alfresco.module.org_alfresco_module_rm.util.ServiceBaseImpl;
import org.alfresco.service.cmr.dictionary.DictionaryService;
@@ -97,11 +98,12 @@ public class ContentClassificationServiceImpl extends ServiceBaseImpl implements
throw new UnsupportedOperationException(
"The content has already been classified. Reclassification is currently not supported.");
}
if (!securityClearanceService.isCurrentUserClearedForClassification(classificationLevelId))
{
throw new LevelIdNotFound(classificationLevelId);
}
Map<QName, Serializable> properties = new HashMap<QName, Serializable>();
// Check the classification level id - an exception will be thrown if the id cannot be found
levelManager.findLevelById(classificationLevelId);
// Initial classification id
if (nodeService.getProperty(content, PROP_INITIAL_CLASSIFICATION) == null)
{