mirror of
https://github.com/essentials/Essentials.git
synced 2025-08-26 16:04:27 +02:00
Reduce permissions checking when generating /help
This commit is contained in:
@@ -47,6 +47,7 @@ public class HelpInput implements IText
|
|||||||
newLines.clear();
|
newLines.clear();
|
||||||
lines.add(_("helpFrom", p.getDescription().getName()));
|
lines.add(_("helpFrom", p.getDescription().getName()));
|
||||||
}
|
}
|
||||||
|
final boolean isOnWhitelist = user.isAuthorized("essentials.help." + pluginNameLow);
|
||||||
|
|
||||||
for (Map.Entry<String, Map<String, Object>> k : cmds.entrySet())
|
for (Map.Entry<String, Map<String, Object>> k : cmds.entrySet())
|
||||||
{
|
{
|
||||||
@@ -81,7 +82,7 @@ public class HelpInput implements IText
|
|||||||
{
|
{
|
||||||
permissions = value.get(PERMISSIONS);
|
permissions = value.get(PERMISSIONS);
|
||||||
}
|
}
|
||||||
if (user.isAuthorized("essentials.help." + pluginNameLow))
|
if (isOnWhitelist)
|
||||||
{
|
{
|
||||||
pluginLines.add(_("helpLine", k.getKey(), value.get(DESCRIPTION)));
|
pluginLines.add(_("helpLine", k.getKey(), value.get(DESCRIPTION)));
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user