From bc96accde0fee3c88f2416282facbc7e32f185c4 Mon Sep 17 00:00:00 2001 From: Steven Smith Date: Sun, 27 Jan 2013 13:01:36 +0800 Subject: [PATCH 1/2] Add permissions node --- .gitignore | 9 ++++++++- src/com/exolius/simplebackup/Commands.java | 2 +- src/plugin.yml | 7 ++++++- 3 files changed, 15 insertions(+), 3 deletions(-) diff --git a/.gitignore b/.gitignore index 5dcc7a5..2c68de3 100644 --- a/.gitignore +++ b/.gitignore @@ -36,4 +36,11 @@ .DS_Store* ehthumbs.db Icon? -Thumbs.db \ No newline at end of file +Thumbs.db + +# Eclipse stuff # +################# +bin/ +bin1/ +.classpath +.project \ No newline at end of file diff --git a/src/com/exolius/simplebackup/Commands.java b/src/com/exolius/simplebackup/Commands.java index 6079664..6cb1926 100644 --- a/src/com/exolius/simplebackup/Commands.java +++ b/src/com/exolius/simplebackup/Commands.java @@ -17,7 +17,7 @@ public Commands(SimpleBackup plugin) { @Override public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args) { if (cmd.getName().equalsIgnoreCase("sbackup")) { - if (sender.isOp()) { + if (sender.isOp() || sender.hasPermission("simplebackup.use")) { new Thread(new Runnable() { @Override public void run() { diff --git a/src/plugin.yml b/src/plugin.yml index 476de5f..b2ef47c 100644 --- a/src/plugin.yml +++ b/src/plugin.yml @@ -5,4 +5,9 @@ version: 1.4 commands: sbackup: description: Run map backup - usage: /sbackup \ No newline at end of file + usage: /sbackup + +permissions: + simplebackup.use: + description: Run map backup + default: op \ No newline at end of file From f0aa7c866fb2e780b053629535907ad84a58d272 Mon Sep 17 00:00:00 2001 From: blha303 Date: Thu, 18 Apr 2013 22:17:16 +0800 Subject: [PATCH 2/2] Admins should be able to deny permissions to anyone, even ops. the default: op bit in plugin.yml gives this permission to ops by default --- src/com/exolius/simplebackup/Commands.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/com/exolius/simplebackup/Commands.java b/src/com/exolius/simplebackup/Commands.java index 6cb1926..a25d520 100644 --- a/src/com/exolius/simplebackup/Commands.java +++ b/src/com/exolius/simplebackup/Commands.java @@ -17,7 +17,7 @@ public Commands(SimpleBackup plugin) { @Override public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args) { if (cmd.getName().equalsIgnoreCase("sbackup")) { - if (sender.isOp() || sender.hasPermission("simplebackup.use")) { + if (sender.hasPermission("simplebackup.use")) { new Thread(new Runnable() { @Override public void run() { @@ -29,4 +29,4 @@ public void run() { } return false; } -} \ No newline at end of file +}