Merged 5.0.N (5.0.4) to 5.1.N (5.1.2)

127102 rmunteanu: MNT-15614 : Site with name "IT" cannot be managed properly
      - Changed the way the role name is striped out.
      - Implemented tests.


git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/BRANCHES/DEV/5.1.N/root@127134 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Cristian Turlica
2016-05-16 14:53:18 +00:00
parent cfa7b2b72f
commit bd12ec9489
3 changed files with 64 additions and 5 deletions

View File

@@ -2262,10 +2262,11 @@ public class SiteServiceImpl extends AbstractLifecycleBean implements SiteServic
List<String> groups = getPermissionGroups(shortName, authorityName);
for (String group : groups)
{
int index = group.indexOf(shortName) + shortName.length();
String shortNamePattern = '_' + shortName + '_';
int index = group.lastIndexOf(shortNamePattern) + (shortNamePattern).length();
if (index != -1)
{
result.add(group.substring(index + 1));
result.add(group.substring(index));
}
}
return result;