From 1218a0b217ddbcb335aaf55eedbe078fc78d4c87 Mon Sep 17 00:00:00 2001 From: KHobbits Date: Thu, 20 Dec 2012 22:54:36 +0000 Subject: [PATCH] Reduce permissions checking when generating /help --- .../src/com/earth2me/essentials/textreader/HelpInput.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Essentials/src/com/earth2me/essentials/textreader/HelpInput.java b/Essentials/src/com/earth2me/essentials/textreader/HelpInput.java index 4efb6c43f..60d567f65 100644 --- a/Essentials/src/com/earth2me/essentials/textreader/HelpInput.java +++ b/Essentials/src/com/earth2me/essentials/textreader/HelpInput.java @@ -47,6 +47,7 @@ public class HelpInput implements IText newLines.clear(); lines.add(_("helpFrom", p.getDescription().getName())); } + final boolean isOnWhitelist = user.isAuthorized("essentials.help." + pluginNameLow); for (Map.Entry> k : cmds.entrySet()) { @@ -81,7 +82,7 @@ public class HelpInput implements IText { permissions = value.get(PERMISSIONS); } - if (user.isAuthorized("essentials.help." + pluginNameLow)) + if (isOnWhitelist) { pluginLines.add(_("helpLine", k.getKey(), value.get(DESCRIPTION))); }