Add audit bypass permissions

Dynamic permission `qol.audit.bypass.<command>`
master
Etzelia 2018-09-25 20:48:58 +02:00 committed by Gitea
commit 52e2cea05a
1 changed files with 3 additions and 1 deletions

View File

@ -34,6 +34,8 @@ public class CommandPreprocessListener implements Listener {
String command = event.getMessage();
String base = command.split(" ")[0].substring(1).toLowerCase(); // Strip the slash
String auditBypassPerm = "qol.audit.bypass." + base;
Player sender = event.getPlayer();
DynmapAPI dynmap = plugin.getDynmap();
@ -77,7 +79,7 @@ public class CommandPreprocessListener implements Listener {
}
// Command Auditing
if (sender.hasPermission("qol.audit") && plugin.getConfig().getBoolean("audit.enabled")) {
if (sender.hasPermission("qol.audit") && !sender.hasPermission(auditBypassPerm) && plugin.getConfig().getBoolean("audit.enabled")) {
boolean auditable = false;
for (String audit : QoL.getAudits()) {