diff --git a/src/net/crystalyx/bukkit/simplyperms/SimplyCommands.java b/src/net/crystalyx/bukkit/simplyperms/SimplyCommands.java index e0ddef9..23ac1fe 100755 --- a/src/net/crystalyx/bukkit/simplyperms/SimplyCommands.java +++ b/src/net/crystalyx/bukkit/simplyperms/SimplyCommands.java @@ -441,19 +441,32 @@ public class SimplyCommands implements CommandExecutor { private boolean checkPerm(CommandSender sender, String node, List subnodes) { boolean ok = sender.hasPermission("permissions." + node + ".*"); - if (!ok) { - for (String subnode : subnodes) { - String testnode = ""; - for (String sub : subnode.split(".")) { - testnode += sub; - if (sender.hasPermission("permissions." + node + "." + testnode) - || sender.hasPermission("permissions." + node + "." + testnode + ".*")) { + for (String subnode : subnodes) { + String testnode = ""; + for (String sub : subnode.split(".")) { + testnode += sub; + if (sender.isPermissionSet("permissions." + node + "." + testnode)) { + if (ok && !sender.hasPermission("permissions." + node + "." + testnode)) { + ok = false; + break; + } + else if (!ok && sender.hasPermission("permissions." + node + "." + testnode)) { + ok = true; + break; + } + } + else if (sender.isPermissionSet("permissions." + node + "." + testnode + ".*")) { + if (ok && !sender.hasPermission("permissions." + node + "." + testnode + ".*")) { + ok = false; + break; + } + else if (!ok && sender.hasPermission("permissions." + node + "." + testnode + ".*")) { ok = true; break; } } - if (ok) break; } + if (!ok) break; } if (!ok) { sender.sendMessage(ChatColor.RED + "You do not have permissions to do that.");