From 05b1122d669b33950a8f9e768aeee776d88156af Mon Sep 17 00:00:00 2001 From: montlikadani Date: Fri, 17 Apr 2020 08:46:13 +0200 Subject: [PATCH] Add permissions for quests start & stop --- .../com/gamingmesh/jobs/commands/list/quests.java | 4 ++-- src/main/resources/plugin.yml | 11 +++++++++-- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/src/main/java/com/gamingmesh/jobs/commands/list/quests.java b/src/main/java/com/gamingmesh/jobs/commands/list/quests.java index b4804d32..9f2cdb1e 100644 --- a/src/main/java/com/gamingmesh/jobs/commands/list/quests.java +++ b/src/main/java/com/gamingmesh/jobs/commands/list/quests.java @@ -55,9 +55,9 @@ public class quests implements Cmd { if (args.length >= 1) { Boolean stopped = null; String cmd = args.length == 1 ? args[0] : args[1]; - if (cmd.equalsIgnoreCase("stop")) { + if (cmd.equalsIgnoreCase("stop") && Jobs.hasPermission(sender, "jobs.command.admin.quests.stop", false)) { stopped = true; - } else if (cmd.equalsIgnoreCase("start")) { + } else if (cmd.equalsIgnoreCase("start") && Jobs.hasPermission(sender, "jobs.command.admin.quests.start", false)) { stopped = false; } diff --git a/src/main/resources/plugin.yml b/src/main/resources/plugin.yml index d3433a50..fa40b452 100644 --- a/src/main/resources/plugin.yml +++ b/src/main/resources/plugin.yml @@ -28,6 +28,15 @@ permissions: jobs.use: description: Grants ability to use this plugin default: true + jobs.command.admin.*: + description: Grants player access to all commands + default: false + children: + jobs.command.*: true + jobs.command.admin.stats: true + jobs.command.admin.archive: true + jobs.command.admin.quests.stop: true + jobs.command.admin.quests.start: true jobs.command.*: description: Grants player access to all commands default: false @@ -35,8 +44,6 @@ permissions: jobs.command.archive: true jobs.command.browse: true jobs.command.stats: true - jobs.command.admin.stats: true - jobs.command.admin.archive: true jobs.command.archive: true jobs.command.join: true jobs.command.leave: true