mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-10-08 14:51:49 +00:00
Merged HEAD-BUG-FIX (5.1/Cloud) to HEAD (5.1/Cloud)
102708: Merged 5.0.N (5.0.2) to HEAD-BUG-FIX (5.1/Cloud) 102489: Merged V4.2-BUG-FIX (4.2.5) to 5.0.N (5.0.2) 102284: Merged DEV to V4.2-BUG-FIX 101812 : MNT-13710 : User cannot change site role if its current role contains an underscore - Added new unit test. Corrected some code. git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@103538 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -19,6 +19,8 @@
|
||||
package org.alfresco.repo.site;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
@@ -67,6 +69,7 @@ import org.alfresco.service.cmr.tagging.TaggingService;
|
||||
import org.alfresco.service.namespace.NamespaceService;
|
||||
import org.alfresco.service.namespace.QName;
|
||||
import org.alfresco.test_category.BaseSpringTestsCategory;
|
||||
import org.alfresco.util.ApplicationContextHelper;
|
||||
import org.alfresco.util.BaseAlfrescoSpringTest;
|
||||
import org.alfresco.util.GUID;
|
||||
import org.alfresco.util.PropertyMap;
|
||||
@@ -659,6 +662,60 @@ public class SiteServiceImplTest extends BaseAlfrescoSpringTest
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String[] getConfigLocations()
|
||||
{
|
||||
String[] existingConfigLocations = ApplicationContextHelper.CONFIG_LOCATIONS;
|
||||
|
||||
List<String> locations = Arrays.asList(existingConfigLocations);
|
||||
List<String> mutableLocationsList = new ArrayList<String>(locations);
|
||||
mutableLocationsList.add("classpath:org/alfresco/repo/site/site-custom-context.xml");
|
||||
|
||||
String[] result = mutableLocationsList.toArray(new String[mutableLocationsList.size()]);
|
||||
return result;
|
||||
}
|
||||
|
||||
public void testMNT_13710() throws Exception
|
||||
{
|
||||
final String user = "user";
|
||||
|
||||
String siteName = "test" + System.currentTimeMillis();
|
||||
|
||||
List<String> roleList = new ArrayList<String>();
|
||||
roleList.add("test_customrole");
|
||||
roleList.add("testCustomrole");
|
||||
|
||||
try
|
||||
{
|
||||
authenticationComponent.setCurrentUser(AuthenticationUtil.getAdminUserName());
|
||||
|
||||
SiteInfo siteInfo = this.siteService.createSite(siteName, siteName, siteName, siteName, SiteVisibility.PUBLIC);
|
||||
|
||||
createUser(user, user);
|
||||
|
||||
for(String role : roleList)
|
||||
{
|
||||
this.siteService.setMembership(siteInfo.getShortName(), user, role);
|
||||
|
||||
List<String> list = this.siteServiceImpl.getMembersRoles(siteName, user);
|
||||
|
||||
assertTrue(list.contains(role));
|
||||
}
|
||||
}
|
||||
finally
|
||||
{
|
||||
if (siteService.getSite(siteName) != null)
|
||||
{
|
||||
siteService.deleteSite(siteName);
|
||||
}
|
||||
|
||||
if (this.personService.getPerson(user) != null)
|
||||
{
|
||||
this.personService.deletePerson(user);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Test listSite case sensitivity
|
||||
*/
|
||||
|
Reference in New Issue
Block a user