From b74efb38462b4b4bbcc9ecb76319429aed10cacc Mon Sep 17 00:00:00 2001 From: Andrei Rebegea Date: Wed, 14 Jun 2017 16:57:38 +0000 Subject: [PATCH] Merged 5.2.N (5.2.2) to HEAD (5.2) 134403 mward: 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/HEAD/root@137345 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261 --- source/java/org/alfresco/rest/api/impl/GroupsImpl.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/source/java/org/alfresco/rest/api/impl/GroupsImpl.java b/source/java/org/alfresco/rest/api/impl/GroupsImpl.java index 8a361e9568..d5da30b87e 100644 --- a/source/java/org/alfresco/rest/api/impl/GroupsImpl.java +++ b/source/java/org/alfresco/rest/api/impl/GroupsImpl.java @@ -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); }