Switching priority on help permissions

Bukkit #1488
This commit is contained in:
KHobbits 2011-11-22 04:41:34 +00:00
parent 2620e2ae08
commit bf244fff80
3 changed files with 8 additions and 8 deletions

View File

@ -67,19 +67,16 @@ public class HelpInput implements IText
{ {
permissions = value.get(PERMISSIONS); permissions = value.get(PERMISSIONS);
} }
if (permissions instanceof String && !permissions.equals("")) if (user.isAuthorized("essentials.help." + pluginName))
{ {
if (user.isAuthorized((String)permissions)) lines.add("§c" + k.getKey() + "§7: " + value.get(DESCRIPTION));
{
lines.add("§c" + k.getKey() + "§7: " + value.get(DESCRIPTION));
}
} }
else if (permissions instanceof List && !((List<Object>)permissions).isEmpty()) else if (permissions instanceof List && !((List<Object>)permissions).isEmpty())
{ {
boolean enabled = false; boolean enabled = false;
for (Object o : (List<Object>)permissions) for (Object o : (List<Object>)permissions)
{ {
if (o instanceof String && user.isAuthorized((String)o)) if (o instanceof String && user.isAuthorized(o.toString()))
{ {
enabled = true; enabled = true;
break; break;
@ -90,9 +87,12 @@ public class HelpInput implements IText
lines.add("§c" + k.getKey() + "§7: " + value.get(DESCRIPTION)); lines.add("§c" + k.getKey() + "§7: " + value.get(DESCRIPTION));
} }
} }
else if (user.isAuthorized("essentials.help." + pluginName)) else if (permissions instanceof String && !"".equals(permissions))
{ {
lines.add("§c" + k.getKey() + "§7: " + value.get(DESCRIPTION)); if (user.isAuthorized(permissions.toString()))
{
lines.add("§c" + k.getKey() + "§7: " + value.get(DESCRIPTION));
}
} }
else else
{ {

Binary file not shown.

Binary file not shown.