From f629d91dc76ffce0a75d7426efd1c7c759057011 Mon Sep 17 00:00:00 2001 From: Jannik <62625225+Lorias-Jak@users.noreply.github.com> Date: Fri, 8 Sep 2023 10:03:38 +0200 Subject: [PATCH] fix(velocity): permissions check (#986) --- .../me.confuser.banmanager.velocity/VelocityCommand.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/velocity/src/main/java/me.confuser.banmanager.velocity/VelocityCommand.java b/velocity/src/main/java/me.confuser.banmanager.velocity/VelocityCommand.java index 395d2dc7..db74c38d 100644 --- a/velocity/src/main/java/me.confuser.banmanager.velocity/VelocityCommand.java +++ b/velocity/src/main/java/me.confuser.banmanager.velocity/VelocityCommand.java @@ -9,6 +9,7 @@ import me.confuser.banmanager.common.BanManagerPlugin; import me.confuser.banmanager.common.commands.CommonCommand; import me.confuser.banmanager.common.commands.CommonSender; +import me.confuser.banmanager.common.util.Message; import java.lang.reflect.InvocationTargetException; import java.util.Collections; @@ -34,6 +35,11 @@ public void execute(final Invocation invocation) { CommonSender commonSender = getSender(commandSource); boolean success = false; + if (!commonSender.hasPermission(command.getPermission())) { + commonSender.sendMessage(Message.getString("sender.error.noPermission")); + return; + } + try { success = this.command.onCommand(commonSender, this.command.getParser(args)); } catch (NoSuchMethodException | IllegalAccessException | InstantiationException | InvocationTargetException e) {