mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-07-24 17:32:48 +00:00
Fixed AR-626: Default aspects not being checked for.
- The NodeService was preventing the removal of required aspects - This is now enforced by integrity git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@3030 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -595,20 +595,6 @@ public class DbNodeServiceImpl extends AbstractNodeServiceImpl
|
||||
// get the node
|
||||
Node node = getNodeNotNull(nodeRef);
|
||||
|
||||
// check that the aspect may be removed
|
||||
TypeDefinition nodeTypeDef = dictionaryService.getType(node.getTypeQName());
|
||||
if (nodeTypeDef == null)
|
||||
{
|
||||
throw new InvalidNodeRefException("The node type is no longer valid: " + nodeRef, nodeRef);
|
||||
}
|
||||
List<AspectDefinition> defaultAspects = nodeTypeDef.getDefaultAspects();
|
||||
if (defaultAspects.contains(aspectDef))
|
||||
{
|
||||
throw new InvalidAspectException(
|
||||
"The aspect is a default for the node's type and cannot be removed: " + aspectTypeQName,
|
||||
aspectTypeQName);
|
||||
}
|
||||
|
||||
// remove the aspect, if present
|
||||
boolean removed = node.getAspects().remove(aspectTypeQName);
|
||||
// if the aspect was present, remove the associated properties
|
||||
|
Reference in New Issue
Block a user