Merge remote-tracking branch 'origin/release/V2.7' into merge-3.0/MNT-21585

This commit is contained in:
Eva Vasques
2020-06-09 17:20:15 +01:00

View File

@@ -407,13 +407,12 @@ public class ExtendedSecurityServiceImpl extends ServiceBaseImpl
// if exists and matches we have found our group // if exists and matches we have found our group
if (isIPRGroupTrueMatch(group, authorities)) if (isIPRGroupTrueMatch(group, authorities))
{ {
iprGroup = group; return new Pair<String, Integer>(group, nextGroupIndex);
break;
} }
} }
// determine if there are any more pages to inspect // determine if there are any more pages to inspect
hasMoreItems = results.hasMoreItems(); hasMoreItems = hasMoreItems ? results.hasMoreItems() : false;
pageCount ++; pageCount ++;
} }
@@ -429,8 +428,15 @@ public class ExtendedSecurityServiceImpl extends ServiceBaseImpl
*/ */
private boolean isIPRGroupTrueMatch(String group, Set<String> authorities) private boolean isIPRGroupTrueMatch(String group, Set<String> authorities)
{ {
//Remove GROUP_EVERYONE for proper comparison as GROUP_EVERYONE is never included in an IPR group
Set<String> plainAuthorities = new HashSet<String>();
if (authorities != null)
{
plainAuthorities.addAll(authorities);
plainAuthorities.remove(PermissionService.ALL_AUTHORITIES);
}
Set<String> contained = authorityService.getContainedAuthorities(null, group, true); Set<String> contained = authorityService.getContainedAuthorities(null, group, true);
return contained.equals(authorities); return contained.equals(plainAuthorities);
} }
/** /**