Merged HEAD-BUG-FIX (5.0/Cloud) to HEAD (4.3/Cloud)

73691: Merged V4.2-BUG-FIX (4.2.3) to HEAD-BUG-FIX (4.3/Cloud)
      73613: Merged V4.1-BUG-FIX (4.1.10) to V4.2-BUG-FIX (4.2.3)
         73399: Merged DEV to V4.1-BUG-FIX (4.1.10)
            70066: MNT-2229 Wrong user role is displayed in site members dashlet. 
            72036: MNT-2229 Wrong user role is displayed in site members dashlet.
                     - In SiteServiceImplTest was added testUserRoleInGroups() test.


git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@74806 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Will Abson
2014-06-25 16:07:45 +00:00
parent 88f2d1dc6f
commit c155d62f06
3 changed files with 49 additions and 7 deletions

View File

@@ -34,13 +34,21 @@ import java.util.Map;
this.setRolePrecedence(rolePrecedence);
}
public int compare(String first, String second)
{
int firstRank = getRolePrecedence().get(first);
int secondRank = getRolePrecedence().get(second);
return secondRank - firstRank;
}
public int compare(String first, String second)
{
int firstRank = 0;
int secondRank = 0;
if (getRolePrecedence().containsKey(first))
{
firstRank = getRolePrecedence().get(first);
}
if (getRolePrecedence().containsKey(second))
{
secondRank = getRolePrecedence().get(second);
}
return secondRank > firstRank ? 1 : secondRank < firstRank ? -1 : 0;
}
public void init()
{