From b3fc7900009746ad2b5a007b045c0a9d3d015008 Mon Sep 17 00:00:00 2001 From: KHobbits Date: Thu, 9 Feb 2012 22:11:46 +0000 Subject: New Permission: essentials.sudo.exempt If a user has this perm, they cannot be controlled. --- Essentials/src/com/earth2me/essentials/commands/Commandsudo.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandsudo.java b/Essentials/src/com/earth2me/essentials/commands/Commandsudo.java index 7f758ad2e..86394e502 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandsudo.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandsudo.java @@ -30,7 +30,13 @@ public class Commandsudo extends EssentialsCommand } //TODO: Translate this. - sender.sendMessage("Running the command as " + user.getDisplayName()); + if (user.isAuthorized("essentials.sudo.exempt")) + { + throw new Exception("You cannot sudo this user"); + } + + //TODO: Translate this. + sender.sendMessage("Forcing " + user.getDisplayName() + " to run: /" + command + " " + arguments); final PluginCommand execCommand = ess.getServer().getPluginCommand(command); if (execCommand != null) -- cgit v1.2.3