1
0
mirror of synced 2026-08-31 22:46:02 +00:00

Allow ACL to be owned by GrantedAuthoritySid

Closes gh-9425
This commit is contained in:
Roberto Paolillo
2021-02-12 13:15:06 +01:00
committed by Joe Grandja
parent 92b3a7b01b
commit efb394d3b2
2 changed files with 18 additions and 2 deletions
@@ -93,11 +93,17 @@ public class AclAuthorizationStrategyImpl implements AclAuthorizationStrategy {
&& ((changeType == CHANGE_GENERAL) || (changeType == CHANGE_OWNERSHIP))) {
return;
}
// Not authorized by ACL ownership; try via adminstrative permissions
GrantedAuthority requiredAuthority = getRequiredAuthority(changeType);
// Iterate this principal's authorities to determine right
Set<String> authorities = AuthorityUtils.authorityListToSet(authentication.getAuthorities());
if (acl.getOwner() instanceof GrantedAuthoritySid
&& authorities.contains(((GrantedAuthoritySid) acl.getOwner()).getGrantedAuthority())) {
return;
}
// Not authorized by ACL ownership; try via adminstrative permissions
GrantedAuthority requiredAuthority = getRequiredAuthority(changeType);
if (authorities.contains(requiredAuthority.getAuthority())) {
return;
}