Merged RETURN-OF-THE-API (5.2.0) to 5.2.N (5.2.1)

128135 jvonka: v1 REST API:  fix possible NPE when optionally listing allowable ops for non-file/non-file (+ add sanity api test)
   REPO-488, REPO-514


git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/BRANCHES/DEV/5.2.N/root@129127 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Martin Muller
2016-08-05 10:12:38 +00:00
parent f4db00acf7
commit f88cccb1b7
2 changed files with 19 additions and 4 deletions

View File

@@ -903,9 +903,9 @@ public class NodesImpl implements Nodes
String perm = kv.getKey();
String op = kv.getValue();
if (perm.equals(PermissionService.ADD_CHILDREN) && type.equals(Type.DOCUMENT))
if (perm.equals(PermissionService.ADD_CHILDREN) && Type.DOCUMENT.equals(type))
{
// special case: do not return "create" (as an allowable op) for file/content types
// special case: do not return "create" (as an allowable op) for file/content types - note: 'type' can be null
continue;
}
else if (perm.equals(PermissionService.DELETE) && (isSpecialNodeDoNotDelete(nodeRef, nodeTypeQName)))