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:
Florian CUNY 2018-08-07 16:42:47 +02:00
parent 1455d6e7f5
commit aab7d4a649

View File

@ -144,8 +144,8 @@ public abstract class AbstractFlagListener implements Listener {
return false;
}
// Ops or bypass mods can do anything
if (user.isOp() || user.hasPermission(getIWM().getPermissionPrefix(loc.getWorld()) + ".mod.bypassprotect")) {
// Ops or "bypass everywhere" moderators can do anything
if (user.isOp() || user.hasPermission(getIWM().getPermissionPrefix(loc.getWorld()) + ".mod.bypass." + flag.getID() + ".everywhere")) {
user = null;
return true;
}
@ -154,7 +154,8 @@ public abstract class AbstractFlagListener implements Listener {
User.setPlugin(plugin);
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);
// Clear the user for the next time
user = null;