Merged mward/5.2.n-repo-1583-groupmem (5.2.1) to 5.2.N (5.2.1)

134397 mward: REPO-1583: implementing feedback from CR-667 review


git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/BRANCHES/DEV/5.2.N/root@134403 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Matt Ward
2017-01-17 14:23:04 +00:00
parent c096c60c22
commit 45747175d5

View File

@@ -51,6 +51,7 @@ import org.alfresco.rest.workflow.api.impl.MapBasedQueryWalkerOrSupported;
import org.alfresco.service.cmr.security.AuthorityService;
import org.alfresco.service.cmr.security.AuthorityType;
import org.alfresco.util.AlfrescoCollator;
import org.alfresco.service.cmr.security.PermissionService;
import org.alfresco.util.Pair;
import org.springframework.extensions.surf.util.I18NUtil;
@@ -205,7 +206,7 @@ public class GroupsImpl implements Groups
String currentUserId = AuthenticationUtil.getFullyAuthenticatedUser();
if (!isAdmin && !currentUserId.equalsIgnoreCase(personId))
{
// The user is not an admin user and is not attempting to update *their own* details.
// The user is not an admin user and is not attempting to retrieve *their own* details.
throw new PermissionDeniedException();
}
@@ -349,8 +350,8 @@ public class GroupsImpl implements Groups
throw new InvalidArgumentException("id is null or empty");
}
// authorityService.authorityExists("GROUP_EVERYONE") returns false!
if (!id.equals("GROUP_EVERYONE") && !authorityService.authorityExists(id))
// authorityService.authorityExists(ALL_AUTHORITIES) returns false!
if (!id.equals(PermissionService.ALL_AUTHORITIES) && !authorityService.authorityExists(id))
{
throw new EntityNotFoundException(id);
}