mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-07-31 17:39:05 +00:00
MNT-21585 - Having EVERYONE in original ACL causes IPR duplication (#1144)
* MNT-21585 - Having EVERYONE in original authorities causes IPR duplication * Update License Headers * prevent NPE when authorities is null and refactored findIPRGroup method
This commit is contained in:
@@ -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);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Reference in New Issue
Block a user