diff options
author | KHobbits <rob@khobbits.co.uk> | 2012-03-23 18:26:19 +0000 |
---|---|---|
committer | KHobbits <rob@khobbits.co.uk> | 2012-03-23 18:26:19 +0000 |
commit | c793fc13a73c300ec48aa59b1bb0ca25c52062e3 (patch) | |
tree | 3f72f051ced9fed260a3232a241d01cca72fccd2 | |
parent | 45a45284cd748e2021faa5de9e516e914491c51a (diff) | |
download | Essentials-c793fc13a73c300ec48aa59b1bb0ca25c52062e3.tar Essentials-c793fc13a73c300ec48aa59b1bb0ca25c52062e3.tar.gz Essentials-c793fc13a73c300ec48aa59b1bb0ca25c52062e3.tar.lz Essentials-c793fc13a73c300ec48aa59b1bb0ca25c52062e3.tar.xz Essentials-c793fc13a73c300ec48aa59b1bb0ca25c52062e3.zip |
Fix for showing plugins when user has no permission.
-rw-r--r-- | Essentials/src/com/earth2me/essentials/textreader/HelpInput.java | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/Essentials/src/com/earth2me/essentials/textreader/HelpInput.java b/Essentials/src/com/earth2me/essentials/textreader/HelpInput.java index 76316c94d..4efb6c43f 100644 --- a/Essentials/src/com/earth2me/essentials/textreader/HelpInput.java +++ b/Essentials/src/com/earth2me/essentials/textreader/HelpInput.java @@ -36,6 +36,7 @@ public class HelpInput implements IText { try { + final List<String> pluginLines = new ArrayList<String>(); final PluginDescriptionFile desc = p.getDescription(); final Map<String, Map<String, Object>> cmds = desc.getCommands(); pluginName = p.getDescription().getName(); @@ -63,7 +64,7 @@ public class HelpInput implements IText final String node = "essentials." + k.getKey(); if (!ess.getSettings().isCommandDisabled(k.getKey()) && user.isAuthorized(node)) { - newLines.add(_("helpLine", k.getKey(), k.getValue().get(DESCRIPTION))); + pluginLines.add(_("helpLine", k.getKey(), k.getValue().get(DESCRIPTION))); } } else @@ -82,7 +83,7 @@ public class HelpInput implements IText } if (user.isAuthorized("essentials.help." + pluginNameLow)) { - newLines.add(_("helpLine", k.getKey(), value.get(DESCRIPTION))); + pluginLines.add(_("helpLine", k.getKey(), value.get(DESCRIPTION))); } else if (permissions instanceof List && !((List<Object>)permissions).isEmpty()) { @@ -97,21 +98,21 @@ public class HelpInput implements IText } if (enabled) { - newLines.add(_("helpLine", k.getKey(), value.get(DESCRIPTION))); + pluginLines.add(_("helpLine", k.getKey(), value.get(DESCRIPTION))); } } else if (permissions instanceof String && !"".equals(permissions)) { if (user.isAuthorized(permissions.toString())) { - newLines.add(_("helpLine", k.getKey(), value.get(DESCRIPTION))); + pluginLines.add(_("helpLine", k.getKey(), value.get(DESCRIPTION))); } } else { if (!ess.getSettings().hidePermissionlessHelp()) { - newLines.add(_("helpLine", k.getKey(), value.get(DESCRIPTION))); + pluginLines.add(_("helpLine", k.getKey(), value.get(DESCRIPTION))); } } } @@ -122,8 +123,9 @@ public class HelpInput implements IText continue; } } - if (!newLines.isEmpty()) + if (!pluginLines.isEmpty()) { + newLines.addAll(pluginLines); if (pluginNameLow.equals(match)) { break; |