Merge remote-tracking branch 'origin/release/V3.1' into merge-3.2/MNT-21585

This commit is contained in:
Eva Vasques
2020-06-17 15:39:13 +01:00
2 changed files with 16 additions and 5 deletions

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);
} }
/** /**

View File

@@ -10,5 +10,10 @@ if [ "$docker_images_list" == "" ]; then
echo "No docker images on the agent" echo "No docker images on the agent"
else else
echo "Clearing images: $docker_images_list" echo "Clearing images: $docker_images_list"
docker rmi -f $docker_images_list if docker rmi -f $docker_images_list ; then
echo "Deleting images was successful."
else
echo "Deleting specified images failed, so falling back to delete ALL images on system."
docker rmi -f $(docker images -aq)
fi
fi fi