From cae4925511b78892ccba27143c28c9daddf371f8 Mon Sep 17 00:00:00 2001 From: Joey Hines Date: Tue, 25 Sep 2018 13:36:11 -0500 Subject: [PATCH] Added a check to see if a user has a perm to bypass the audit. --- .../xyz/etztech/qol/listeners/CommandPreprocessListener.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/main/java/xyz/etztech/qol/listeners/CommandPreprocessListener.java b/src/main/java/xyz/etztech/qol/listeners/CommandPreprocessListener.java index 13aba4b..4ce0dc8 100644 --- a/src/main/java/xyz/etztech/qol/listeners/CommandPreprocessListener.java +++ b/src/main/java/xyz/etztech/qol/listeners/CommandPreprocessListener.java @@ -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()) {