mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-07 17:49:17 +00:00
Merged V3.1 to HEAD
13256: Fix ETHREEOH-1221 Hard-coded use of "admin" username ___________________________________________________________________ Modified: svn:mergeinfo Merged /alfresco/BRANCHES/V3.1:r13256 git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@13613 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -59,6 +59,7 @@ import org.alfresco.service.cmr.search.ResultSetRow;
|
||||
import org.alfresco.service.cmr.search.SearchParameters;
|
||||
import org.alfresco.service.cmr.search.SearchService;
|
||||
import org.alfresco.service.cmr.security.AuthorityService;
|
||||
import org.alfresco.service.cmr.security.AuthorityType;
|
||||
import org.alfresco.service.cmr.security.NoSuchPersonException;
|
||||
import org.alfresco.service.cmr.security.PersonService;
|
||||
import org.alfresco.service.namespace.NamespacePrefixResolver;
|
||||
@@ -584,7 +585,12 @@ public class PersonServiceImpl extends TransactionListenerAdapter implements Per
|
||||
public NodeRef createPerson(Map<QName, Serializable> properties)
|
||||
{
|
||||
String userName = DefaultTypeConverter.INSTANCE.convert(String.class, properties.get(ContentModel.PROP_USERNAME));
|
||||
|
||||
AuthorityType authorityType = AuthorityType.getAuthorityType(userName);
|
||||
if (authorityType != AuthorityType.USER)
|
||||
{
|
||||
throw new AlfrescoRuntimeException("Attempt to create person for an authority which is not a user");
|
||||
}
|
||||
|
||||
tenantService.checkDomainUser(userName);
|
||||
|
||||
properties.put(ContentModel.PROP_USERNAME, userName);
|
||||
|
Reference in New Issue
Block a user