diff --git a/bukkit/src/main/resources/config.yml b/bukkit/src/main/resources/config.yml index 821cfc54..ede47790 100644 --- a/bukkit/src/main/resources/config.yml +++ b/bukkit/src/main/resources/config.yml @@ -39,6 +39,9 @@ apply-regex: true # If set to true, LuckPerms will detect and expand shorthand node patterns. apply-shorthand: true +# If the plugin should send log notifications to users whenever permissions are modified. +log-notify: true + # Which storage method the plugin should use. # Currently supported: mysql, sqlite, h2, flatfile, mongodb # Fill out connection info below if you're using MySQL or MongoDB diff --git a/bungee/src/main/resources/config.yml b/bungee/src/main/resources/config.yml index 64dc8db8..db7d394a 100644 --- a/bungee/src/main/resources/config.yml +++ b/bungee/src/main/resources/config.yml @@ -39,6 +39,9 @@ apply-regex: true # If set to true, LuckPerms will detect and expand shorthand node patterns. apply-shorthand: true +# If the plugin should send log notifications to users whenever permissions are modified. +log-notify: true + # Which storage method the plugin should use. # Currently supported: mysql, sqlite, h2, flatfile, mongodb # Fill out connection info below if you're using MySQL or MongoDB diff --git a/common/src/main/java/me/lucko/luckperms/core/LPConfiguration.java b/common/src/main/java/me/lucko/luckperms/core/LPConfiguration.java index 74ef8beb..526eb7b7 100644 --- a/common/src/main/java/me/lucko/luckperms/core/LPConfiguration.java +++ b/common/src/main/java/me/lucko/luckperms/core/LPConfiguration.java @@ -102,6 +102,10 @@ public abstract class LPConfiguration { return getBoolean("apply-shorthand", true); } + public boolean getLogNotify() { + return getBoolean("log-notify", true); + } + public DatastoreConfiguration getDatabaseValues() { return new DatastoreConfiguration( getString("data.address", null), diff --git a/common/src/main/java/me/lucko/luckperms/data/LogEntry.java b/common/src/main/java/me/lucko/luckperms/data/LogEntry.java index 1539cf8f..846a0fb5 100644 --- a/common/src/main/java/me/lucko/luckperms/data/LogEntry.java +++ b/common/src/main/java/me/lucko/luckperms/data/LogEntry.java @@ -52,6 +52,7 @@ public class LogEntry extends me.lucko.luckperms.api.LogEntry { plugin.getDatastore().logAction(this); LogNotifyEvent event = new LogNotifyEvent(this); + event.setCancelled(plugin.getConfiguration().getLogNotify()); plugin.getApiProvider().fireEvent(event); if (event.isCancelled()) return; diff --git a/sponge/src/main/resources/luckperms.conf b/sponge/src/main/resources/luckperms.conf index e072134d..80a480c2 100644 --- a/sponge/src/main/resources/luckperms.conf +++ b/sponge/src/main/resources/luckperms.conf @@ -39,6 +39,9 @@ apply-regex=true # If set to true, LuckPerms will detect and expand shorthand node patterns. apply-shorthand=true +# If the plugin should send log notifications to users whenever permissions are modified. +log-notify=true + # Which storage method the plugin should use. # Currently supported: mysql, sqlite, h2, flatfile, mongodb # Fill out connection info below if you're using MySQL or MongoDB