mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-14 17:58:59 +00:00
Merged 5.2.0 (5.2.0) to HEAD (5.2)
133843 rmunteanu: REPO-1746: Merge fixes for 5.2 GA issues to 5.2.0 branch Merged 5.2.N (5.2.1) to 5.2.0 (5.2.0) 133423 jvonka: REPPO-1579: V1 REST API - create person fix - expect 403 instead of 409, if a non-admin tries to create a person that already exists - REPO-892 git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@134182 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -428,7 +428,13 @@ public class PeopleImpl implements People
|
||||
{
|
||||
validateCreatePersonData(person);
|
||||
|
||||
// TODO: check, is this transaction safe?
|
||||
if (! isAdminAuthority())
|
||||
{
|
||||
// note: do an explict check for admin here (since personExists does not throw 403 unlike createPerson,
|
||||
// hence next block would cause 409 to be returned)
|
||||
throw new PermissionDeniedException();
|
||||
}
|
||||
|
||||
// Unfortunately PersonService.createPerson(...) only throws an AlfrescoRuntimeException
|
||||
// rather than a more specific exception and does not use a message ID either, so there's
|
||||
// no sensible way to know that it was thrown due to the user already existing - hence this check here.
|
||||
|
Reference in New Issue
Block a user