mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-14 17:58:59 +00:00
REPO-1884: Don't allow adding a sub-group with memberType:"PERSON"
- Added validation and tests git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/BRANCHES/DEV/5.2.N/root@134777 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -623,6 +623,12 @@ public class GroupsImpl implements Groups
|
||||
throw new EntityNotFoundException("Group member with id " + groupMember.getId() + " does not exists");
|
||||
}
|
||||
|
||||
AuthorityType existingAuthorityType = AuthorityType.getAuthorityType(groupMember.getId());
|
||||
if (existingAuthorityType != authorityType)
|
||||
{
|
||||
throw new IllegalArgumentException("Incorrect group member type, " + existingAuthorityType + " exists with the given id");
|
||||
}
|
||||
|
||||
authorityService.addAuthority(groupId, groupMember.getId());
|
||||
String authority = authorityService.getName(authorityType, groupMember.getId());
|
||||
|
||||
@@ -728,7 +734,7 @@ public class GroupsImpl implements Groups
|
||||
throw new EntityNotFoundException(groupId);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private void validateGroup(Group group, boolean isUpdate)
|
||||
{
|
||||
if (group == null)
|
||||
|
Reference in New Issue
Block a user