From ae82807139abe6c04edb73ebb1ccf645b0a5ba8d Mon Sep 17 00:00:00 2001 From: Luck Date: Mon, 27 Mar 2017 17:35:28 +0100 Subject: [PATCH] Add "use-vault-server" config option, depreciate vault primary group override feature --- bukkit/src/main/resources/config.yml | 39 ++++++++----------- .../luckperms/common/config/ConfigKeys.java | 9 ++++- 2 files changed, 24 insertions(+), 24 deletions(-) diff --git a/bukkit/src/main/resources/config.yml b/bukkit/src/main/resources/config.yml index abe8385c..6508007e 100644 --- a/bukkit/src/main/resources/config.yml +++ b/bukkit/src/main/resources/config.yml @@ -48,6 +48,16 @@ use-server-uuids: true # If the plugin should send log notifications to users whenever permissions are modified. log-notify: true +# Mirrors world names. Whenever LuckPerms checks what world a user is in, if the world name is in this list, the value assigned +# will be sent forward for permission calculation instead. +world-rewrite: +# world_nether: world +# world_the_end: world + +# Rewrites group names. The underlying name of the group does not change, just the output in commands / placeholders / Vault. +group-name-rewrite: +# default: Member + # Controls how temporary permissions/parents/meta should be accumulated # # The default behaviour is "deny" @@ -154,8 +164,14 @@ commands-allow-op: true # | Vault | # # +------------------------------------------------------------------------+ # +# If the vault-server option below should be used. +# When this option is set to false, the server value defined above under "server" is used. +use-vault-server: false + # The name of the server used within Vault operations. If you don't want Vault operations to be server specific, set this # to "global". +# +# Will only take effect if use-vault-server is set to true above. vault-server: global # If global permissions should be considered when retrieving meta or player groups @@ -164,32 +180,9 @@ vault-include-global: true # If Vault operations should ignore any world arguments if supplied. vault-ignore-world: false -# This block controls the Primary Group override feature -# See the wiki for more information. -vault-primary-groups-overrides: - # If the feature is enabled - enabled: false - # If the check should query the user's inherited permissions. - # (a value of false only checks the permissions they explicitly have) - check-inherited-permissions: false - # If LuckPerms should check if the group exists - check-group-exists: true - # If LuckPerms should check if the user is actually a member of the group - check-user-member-of: true - # If LuckPerms should print debugging info to console when a plugin uses a Vault function vault-debug: false -# Mirrors world names. Whenever LuckPerms checks what world a user is in, if the world name is in this list, the value assigned -# will be sent forward for permission calculation instead. -world-rewrite: -# world_nether: world -# world_the_end: world - -# Rewrites group names. The underlying name of the group does not change, just the output in commands / placeholders / Vault. -group-name-rewrite: -# default: Member - diff --git a/common/src/main/java/me/lucko/luckperms/common/config/ConfigKeys.java b/common/src/main/java/me/lucko/luckperms/common/config/ConfigKeys.java index 63fb27df..73e26bfb 100644 --- a/common/src/main/java/me/lucko/luckperms/common/config/ConfigKeys.java +++ b/common/src/main/java/me/lucko/luckperms/common/config/ConfigKeys.java @@ -137,7 +137,14 @@ public class ConfigKeys { public static final ConfigKey AUTO_OP = EnduringKey.wrap(BooleanKey.of("auto-op", false)); public static final ConfigKey OPS_ENABLED = EnduringKey.wrap(AbstractKey.of(c -> !AUTO_OP.get(c) && c.getBoolean("enable-ops", true))); public static final ConfigKey COMMANDS_ALLOW_OP = EnduringKey.wrap(BooleanKey.of("commands-allow-op", true)); - public static final ConfigKey VAULT_SERVER = LowercaseStringKey.of("vault-server", "global"); + public static final ConfigKey VAULT_SERVER = AbstractKey.of(c -> { + // default to true for backwards compatibility + if (c.getBoolean("use-vault-server", true)) { + return c.getString("vault-server", "global").toLowerCase(); + } else { + return SERVER.get(c); + } + }); public static final ConfigKey VAULT_INCLUDING_GLOBAL = BooleanKey.of("vault-include-global", true); public static final ConfigKey VAULT_IGNORE_WORLD = BooleanKey.of("vault-ignore-world", false); public static final ConfigKey VAULT_PRIMARY_GROUP_OVERRIDES = BooleanKey.of("vault-primary-groups-overrides.enabled", false);