mirror of
https://github.com/BentoBoxWorld/BentoBox.git
synced 2024-10-03 17:17:32 +02:00
Made mod bypass permissions flags-specific & differenciated between everywhere and only on island
This is a 2 in 1 : #70 and #139. Those were long-awaited features. Now it's time for testing !
This commit is contained in:
parent
1455d6e7f5
commit
aab7d4a649
@ -144,8 +144,8 @@ public abstract class AbstractFlagListener implements Listener {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Ops or bypass mods can do anything
|
// Ops or "bypass everywhere" moderators can do anything
|
||||||
if (user.isOp() || user.hasPermission(getIWM().getPermissionPrefix(loc.getWorld()) + ".mod.bypassprotect")) {
|
if (user.isOp() || user.hasPermission(getIWM().getPermissionPrefix(loc.getWorld()) + ".mod.bypass." + flag.getID() + ".everywhere")) {
|
||||||
user = null;
|
user = null;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@ -154,7 +154,8 @@ public abstract class AbstractFlagListener implements Listener {
|
|||||||
User.setPlugin(plugin);
|
User.setPlugin(plugin);
|
||||||
|
|
||||||
if (island.isPresent()) {
|
if (island.isPresent()) {
|
||||||
if (!island.get().isAllowed(user, flag)) {
|
// If it is not allowed on the island, "bypass island" moderators can do anything
|
||||||
|
if (!island.get().isAllowed(user, flag) && !user.hasPermission(getIWM().getPermissionPrefix(loc.getWorld()) + ".mod.bypass." + flag.getID() + ".island")) {
|
||||||
noGo(e, flag, silent);
|
noGo(e, flag, silent);
|
||||||
// Clear the user for the next time
|
// Clear the user for the next time
|
||||||
user = null;
|
user = null;
|
||||||
|
Loading…
Reference in New Issue
Block a user