Fixed issue where settings.* permission was not working

This commit is contained in:
tastybento 2018-08-25 11:28:06 -07:00
parent 474de77ce2
commit 633007630d

View File

@ -38,7 +38,8 @@ public class CycleClick implements PanelItem.ClickHandler {
return true; return true;
} }
String reqPerm = plugin.getIWM().getPermissionPrefix(Util.getWorld(user.getWorld())) + ".settings." + id; String reqPerm = plugin.getIWM().getPermissionPrefix(Util.getWorld(user.getWorld())) + ".settings." + id;
if (!user.hasPermission(reqPerm)) { String allPerms = plugin.getIWM().getPermissionPrefix(Util.getWorld(user.getWorld())) + ".settings.*";
if (!user.hasPermission(reqPerm) && !user.hasPermission(allPerms)) {
user.sendMessage("general.errors.no-permission", TextVariables.PERMISSION, reqPerm); user.sendMessage("general.errors.no-permission", TextVariables.PERMISSION, reqPerm);
user.getPlayer().playSound(user.getLocation(), Sound.BLOCK_METAL_HIT, 1F, 1F); user.getPlayer().playSound(user.getLocation(), Sound.BLOCK_METAL_HIT, 1F, 1F);
return true; return true;