From 9c854f732d640f5b60a68b649e64a88fbfc47d79 Mon Sep 17 00:00:00 2001 From: Minecon724 Date: Thu, 24 Oct 2024 15:28:11 +0200 Subject: [PATCH] Fix permissions --- pom.xml | 2 +- src/main/java/eu/m724/giants/updater/UpdateCommand.java | 5 +++++ src/main/resources/plugin.yml | 2 +- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index 6a9042f..cec29fe 100644 --- a/pom.xml +++ b/pom.xml @@ -53,7 +53,7 @@ eu.m724 jarupdater - 0.1.2 + 0.1.3 diff --git a/src/main/java/eu/m724/giants/updater/UpdateCommand.java b/src/main/java/eu/m724/giants/updater/UpdateCommand.java index 21cd9e1..e77d05b 100644 --- a/src/main/java/eu/m724/giants/updater/UpdateCommand.java +++ b/src/main/java/eu/m724/giants/updater/UpdateCommand.java @@ -51,6 +51,11 @@ public class UpdateCommand { } else { String action = args[1]; // remember this function is proxied + if (!sender.hasPermission("giants.update." + action)) { + sender.sendMessage("You don't have permission to use this command, or it doesn't exist."); + return true; + } + if (action.equals("download")) { sender.sendMessage("Started download"); diff --git a/src/main/resources/plugin.yml b/src/main/resources/plugin.yml index 35f8527..29bda0e 100644 --- a/src/main/resources/plugin.yml +++ b/src/main/resources/plugin.yml @@ -20,7 +20,7 @@ permissions: description: Permits /giants update. Doesn't permit installing update, giants.update for that default: op - giants.update.downloading: + giants.update.download: description: Permits DOWNLOADING the latest update of the Giants plugin. default: op giants.update.install: