REPO-1800: Create group with an id that contains "/" does not return an error

- added validation

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/BRANCHES/DEV/5.2.N/root@134748 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Cristian Turlica
2017-01-25 09:04:42 +00:00
parent 5f20a39cee
commit 216d34a03e
2 changed files with 14 additions and 0 deletions

View File

@@ -701,6 +701,11 @@ public class GroupsImpl implements Groups
throw new InvalidArgumentException("groupId is null or empty");
}
if (group.getId().indexOf('/') != -1)
{
throw new IllegalArgumentException("groupId contains characters that are not permitted.");
}
if (groupAuthorityExists(group.getId()))
{
throw new ConstraintViolatedException("Group '" + group.getId() + "' already exists.");