mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-06-30 18:15:39 +00:00
Merged HEAD-BUG-FIX (4.3/Cloud) to HEAD (4.3/Cloud)
57640: Merged V4.2-BUG-FIX (4.2.1) to HEAD-BUG-FIX (Cloud/4.3) 57627: Merged V4.1-BUG-FIX (4.1.8) to V4.2-BUG-FIX (4.2.1) 57566: Reverse Merged: Appears to have caused build failures https://bamboo.alfresco.com/bamboo/browse/ALF-ENTERPRISEV41BUGFIX-829 57419: Merged DEV to V4.1-BUG-FIX (4.1.8) MNT-9794: Authorities with duplicate names can be easilly created using AuthorityService - ContentModel.PROP_NAME was added for preventing the generation of new uid for every new authority nodes with the duplicated names in 'child_node_name' field into 'alf_child_assoc' table. git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@61864 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
parent
881e324c76
commit
c791da212f
@ -377,9 +377,6 @@ public class AuthorityDAOImpl implements AuthorityDAO, NodeServicePolicies.Befor
|
||||
public void createAuthority(String name, String authorityDisplayName, Set<String> authorityZones)
|
||||
{
|
||||
HashMap<QName, Serializable> props = new HashMap<QName, Serializable>();
|
||||
//MNT-9794 fix. ContentModel.PROP_NAME is added for preventing the generation of new uid for every new authority
|
||||
// nodes with the duplicated names in 'child_node_name' field into 'alf_child_assoc' table
|
||||
props.put(ContentModel.PROP_NAME, name);
|
||||
props.put(ContentModel.PROP_AUTHORITY_NAME, name);
|
||||
props.put(ContentModel.PROP_AUTHORITY_DISPLAY_NAME, authorityDisplayName);
|
||||
NodeRef childRef;
|
||||
|
@ -44,10 +44,8 @@ import org.alfresco.repo.security.authentication.AuthenticationUtil;
|
||||
import org.alfresco.repo.security.authentication.MutableAuthenticationDao;
|
||||
import org.alfresco.repo.transaction.AlfrescoTransactionSupport;
|
||||
import org.alfresco.repo.transaction.AlfrescoTransactionSupport.TxnReadState;
|
||||
import org.alfresco.repo.transaction.RetryingTransactionHelper.RetryingTransactionCallback;
|
||||
import org.alfresco.service.ServiceRegistry;
|
||||
import org.alfresco.service.cmr.repository.ChildAssociationRef;
|
||||
import org.alfresco.service.cmr.repository.DuplicateChildNodeNameException;
|
||||
import org.alfresco.service.cmr.repository.NodeRef;
|
||||
import org.alfresco.service.cmr.repository.NodeService;
|
||||
import org.alfresco.service.cmr.repository.datatype.DefaultTypeConverter;
|
||||
@ -61,7 +59,6 @@ import org.alfresco.service.namespace.QName;
|
||||
import org.alfresco.service.namespace.RegexQNamePattern;
|
||||
import org.alfresco.service.transaction.TransactionService;
|
||||
import org.alfresco.util.ApplicationContextHelper;
|
||||
import org.junit.Test;
|
||||
import org.springframework.context.ApplicationContext;
|
||||
|
||||
public class AuthorityServiceTest extends TestCase
|
||||
@ -113,7 +110,7 @@ public class AuthorityServiceTest extends TestCase
|
||||
|
||||
String defaultAdminUser = AuthenticationUtil.getAdminUserName();
|
||||
AuthenticationUtil.setFullyAuthenticatedUser(defaultAdminUser);
|
||||
|
||||
|
||||
// note: currently depends on any existing (and/or bootstrap) group data - eg. default site "swsdp" (Sample Web Site Design Project)
|
||||
SiteService siteService = (SiteService) ctx.getBean("SiteService");
|
||||
SITE_CNT = siteService.listSites(defaultAdminUser).size();
|
||||
@ -596,22 +593,6 @@ public class AuthorityServiceTest extends TestCase
|
||||
assertEquals(0, pubAuthorityService.getAllRootAuthorities(AuthorityType.ROLE).size());
|
||||
}
|
||||
|
||||
public void createAuthority(final AuthorityType dublicatedAuthorityType, final String dublicatedAuthorityShortName)
|
||||
{
|
||||
final ServiceRegistry serviceRegistry = (ServiceRegistry) ctx.getBean(ServiceRegistry.SERVICE_REGISTRY);
|
||||
TransactionService transactionService = serviceRegistry.getTransactionService();
|
||||
|
||||
RetryingTransactionCallback<Object> exampleWork = new RetryingTransactionCallback<Object>() {
|
||||
public Object execute() throws Exception
|
||||
{
|
||||
pubAuthorityService.createAuthority(dublicatedAuthorityType,
|
||||
dublicatedAuthorityShortName);
|
||||
return null;
|
||||
}
|
||||
};
|
||||
transactionService.getRetryingTransactionHelper().doInTransaction(exampleWork);
|
||||
}
|
||||
|
||||
private void checkAuthorityCollectionSize(int expected, List<String> actual, AuthorityType type)
|
||||
{
|
||||
if (actual.size() != expected)
|
||||
|
Loading…
x
Reference in New Issue
Block a user