Allow passthrough allow on global to override added members/owners.

This commit is contained in:
wizjany 2020-03-29 19:47:57 -04:00
parent aca0d843f6
commit 570b7f7b77

View File

@ -361,7 +361,8 @@ public <V> V getEffectiveFlag(final ProtectedRegion region, Flag<V> flag, @Nulla
if (flag == Flags.PASSTHROUGH) {
// Has members/owners -> the global region acts like
// a regular region without PASSTHROUGH
if (region.hasMembersOrOwners() || region.getFlag(Flags.PASSTHROUGH) == State.DENY) {
State passthrough = region.getFlag(Flags.PASSTHROUGH);
if (passthrough == State.DENY || passthrough != State.ALLOW && region.hasMembersOrOwners()) {
return null;
} else {
return (V) State.ALLOW;