From f5fac6f9f53a4385711a929929b274c538201b00 Mon Sep 17 00:00:00 2001 From: KHobbits Date: Wed, 8 Jun 2011 17:36:43 +0100 Subject: Adding user permission alias --- .../essentials/permissions/Commandmanuaddp.java | 29 ++++++++++++++++++++++ .../essentials/permissions/Commandmanudelp.java | 29 ++++++++++++++++++++++ .../essentials/permissions/Commandmanudelsub.java | 2 +- .../essentials/permissions/Commandmanulistp.java | 28 +++++++++++++++++++++ 4 files changed, 87 insertions(+), 1 deletion(-) create mode 100644 EssentialsPermissionsCommands/src/com/earth2me/essentials/permissions/Commandmanuaddp.java create mode 100644 EssentialsPermissionsCommands/src/com/earth2me/essentials/permissions/Commandmanudelp.java create mode 100644 EssentialsPermissionsCommands/src/com/earth2me/essentials/permissions/Commandmanulistp.java (limited to 'EssentialsPermissionsCommands/src') diff --git a/EssentialsPermissionsCommands/src/com/earth2me/essentials/permissions/Commandmanuaddp.java b/EssentialsPermissionsCommands/src/com/earth2me/essentials/permissions/Commandmanuaddp.java new file mode 100644 index 000000000..0a878af19 --- /dev/null +++ b/EssentialsPermissionsCommands/src/com/earth2me/essentials/permissions/Commandmanuaddp.java @@ -0,0 +1,29 @@ +package com.earth2me.essentials.permissions; + +import com.earth2me.essentials.commands.EssentialsCommand; +import com.earth2me.essentials.commands.NotEnoughArgumentsException; +import org.bukkit.Server; +import org.bukkit.command.CommandSender; + + +public class Commandmanuaddp extends EssentialsCommand +{ + public Commandmanuaddp() + { + super("manuaddp"); + } + + @Override + protected void run(Server server, CommandSender sender, String commandLabel, String[] args) throws Exception + { + if (args.length < 2) + { + throw new NotEnoughArgumentsException(); + } + final String player = args[0]; + final String perm = args[1]; + ess.getServer().dispatchCommand(sender, "/permissions "+player+" perms add "+perm+""); + } + + +} diff --git a/EssentialsPermissionsCommands/src/com/earth2me/essentials/permissions/Commandmanudelp.java b/EssentialsPermissionsCommands/src/com/earth2me/essentials/permissions/Commandmanudelp.java new file mode 100644 index 000000000..229e33d22 --- /dev/null +++ b/EssentialsPermissionsCommands/src/com/earth2me/essentials/permissions/Commandmanudelp.java @@ -0,0 +1,29 @@ +package com.earth2me.essentials.permissions; + +import com.earth2me.essentials.commands.EssentialsCommand; +import com.earth2me.essentials.commands.NotEnoughArgumentsException; +import org.bukkit.Server; +import org.bukkit.command.CommandSender; + + +public class Commandmanudelp extends EssentialsCommand +{ + public Commandmanudelp() + { + super("manudelp"); + } + + @Override + protected void run(Server server, CommandSender sender, String commandLabel, String[] args) throws Exception + { + if (args.length < 2) + { + throw new NotEnoughArgumentsException(); + } + final String player = args[0]; + final String perm = args[1]; + ess.getServer().dispatchCommand(sender, "/permissions "+player+" perms remove "+perm+""); + } + + +} diff --git a/EssentialsPermissionsCommands/src/com/earth2me/essentials/permissions/Commandmanudelsub.java b/EssentialsPermissionsCommands/src/com/earth2me/essentials/permissions/Commandmanudelsub.java index 65f4b091e..f009a78d9 100644 --- a/EssentialsPermissionsCommands/src/com/earth2me/essentials/permissions/Commandmanudelsub.java +++ b/EssentialsPermissionsCommands/src/com/earth2me/essentials/permissions/Commandmanudelsub.java @@ -10,7 +10,7 @@ public class Commandmanudelsub extends EssentialsCommand { public Commandmanudelsub() { - super("manudel"); + super("manudelsub"); } @Override diff --git a/EssentialsPermissionsCommands/src/com/earth2me/essentials/permissions/Commandmanulistp.java b/EssentialsPermissionsCommands/src/com/earth2me/essentials/permissions/Commandmanulistp.java new file mode 100644 index 000000000..511a98b66 --- /dev/null +++ b/EssentialsPermissionsCommands/src/com/earth2me/essentials/permissions/Commandmanulistp.java @@ -0,0 +1,28 @@ +package com.earth2me.essentials.permissions; + +import com.earth2me.essentials.commands.EssentialsCommand; +import com.earth2me.essentials.commands.NotEnoughArgumentsException; +import org.bukkit.Server; +import org.bukkit.command.CommandSender; + + +public class Commandmanulistp extends EssentialsCommand +{ + public Commandmanulistp() + { + super("manuaddp"); + } + + @Override + protected void run(Server server, CommandSender sender, String commandLabel, String[] args) throws Exception + { + if (args.length < 1) + { + throw new NotEnoughArgumentsException(); + } + final String player = args[0]; + ess.getServer().dispatchCommand(sender, "/permissions "+player+" perms list"); + } + + +} -- cgit v1.2.3