Merged HEAD-BUG-FIX (5.1/Cloud) to HEAD (5.1/Cloud)

90771: Merged V4.2-BUG-FIX (4.2.5) to HEAD-BUG-FIX (5.0/Cloud)
      90565: Merged DEV to V4.2-BUG-FIX (4.2.4)
         76855 : MNT-11765 : Public API Authentication: Returns error 500 instead of 401 when authenticated with invalid / non existing user
            - Avoid InvalidStoreRefException in getUserOrNull and getPersonOrNull methods
      90610: MNT-11765 : Public API Authentication: Returns error 500 instead of 401 when authenticated with invalid / non existing user
         - Fix for compilation errors
      90676: MNT-11765 : Public API Authentication: Returns error 500 instead of 401 when authenticated with invalid / non existing user
         - Test is changed to return the system to initial state


git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@94713 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Alan Davis
2015-01-31 11:00:56 +00:00
parent aebd5bf941
commit 46244028c5
3 changed files with 58 additions and 1 deletions

View File

@@ -76,6 +76,7 @@ import org.alfresco.service.cmr.invitation.InvitationException;
import org.alfresco.service.cmr.model.FileFolderService;
import org.alfresco.service.cmr.repository.ChildAssociationRef;
import org.alfresco.service.cmr.repository.InvalidNodeRefException;
import org.alfresco.service.cmr.repository.InvalidStoreRefException;
import org.alfresco.service.cmr.repository.NodeRef;
import org.alfresco.service.cmr.repository.NodeService;
import org.alfresco.service.cmr.repository.StoreRef;
@@ -534,8 +535,18 @@ public class PersonServiceImpl extends TransactionListenerAdapter implements Per
boolean addToCache = false;
if (allRefs == null)
{
NodeRef peopleContainer = null;
try
{
peopleContainer = getPeopleContainer();
}
catch(InvalidStoreRefException isre)
{
return null;
}
List<ChildAssociationRef> childRefs = nodeService.getChildAssocs(
getPeopleContainer(),
peopleContainer,
ContentModel.ASSOC_CHILDREN,
getChildNameLower(searchUserName),
false);