Fixed issues with permissions for /bentobox commands

- Each /bentobox subcommand now has its own dedicated permission
- bentobox.admin is a permission node for most of them
- /bentobox about: bentobox.about
- /bentobox version: bentobox.version
- updated the plugin.yml with the new permissions
This commit is contained in:
Florian CUNY 2019-06-12 10:40:16 +02:00
parent 880185ad4b
commit e7f90bbd21
8 changed files with 31 additions and 7 deletions

View File

@ -22,7 +22,7 @@ public class BentoBoxAboutCommand extends CompositeCommand {
@Override
public void setup() {
// Useless : this command uses the default values.
setPermission("bentobox.about");
}
@Override

View File

@ -20,6 +20,7 @@ public class BentoBoxCatalogCommand extends CompositeCommand {
@Override
public void setup() {
setPermission("bentobox.admin.catalog");
setOnlyPlayer(true);
}

View File

@ -24,7 +24,7 @@ public class BentoBoxLocaleCommand extends ConfirmableCommand {
@Override
public void setup() {
setPermission("admin.locale");
setPermission("bentobox.admin.locale");
setDescription("commands.bentobox.locale.description");
}

View File

@ -20,6 +20,7 @@ public class BentoBoxManageCommand extends CompositeCommand {
@Override
public void setup() {
setPermission("bentobox.admin.manage");
setOnlyPlayer(true);
}

View File

@ -30,7 +30,7 @@ public class BentoBoxMigrateCommand extends ConfirmableCommand {
@Override
public void setup() {
setPermission("admin.migrate");
setPermission("bentobox.admin.migrate");
setDescription("commands.bentobox.migrate.description");
}

View File

@ -26,7 +26,7 @@ public class BentoBoxReloadCommand extends ConfirmableCommand {
@Override
public void setup() {
setPermission("admin.reload");
setPermission("bentobox.admin.reload");
setParametersHelp("commands.bentobox.reload.parameters");
setDescription("commands.bentobox.reload.description");
}

View File

@ -33,7 +33,7 @@ public class BentoBoxVersionCommand extends CompositeCommand {
@Override
public void setup() {
// Not used
setPermission("bentobox.version");
}
@Override

View File

@ -15,5 +15,27 @@ softdepend: [Vault, PlaceholderAPI, MVdWPlaceholderAPI, dynmap]
permissions:
bentobox.admin:
description: Allow bentobox command usage
default: op
description: Allows most of bentobox commands usage
default: op
children:
bentobox.admin.catalog:
description: Allows to use /bentobox catalog
default: op
bentobox.admin.locale:
description: Allows to use /bentobox locale
default: op
bentobox.admin.manage:
description: Allows to use /bentobox manage
default: op
bentobox.admin.migrate:
description: Allows to use /bentobox migrate
default: op
bentobox.admin.reload:
description: Allows to use /bentobox reload
default: op
bentobox.about:
description: Allows to use /bentobox about
default: true
bentobox.version:
description: Allows to use /bentobox version
default: true