diff options
-rw-r--r-- | EssentialsGroupManager/src/org/anjocaido/groupmanager/GroupManager.java | 36 |
1 files changed, 18 insertions, 18 deletions
diff --git a/EssentialsGroupManager/src/org/anjocaido/groupmanager/GroupManager.java b/EssentialsGroupManager/src/org/anjocaido/groupmanager/GroupManager.java index 2ea0007b0..1594755de 100644 --- a/EssentialsGroupManager/src/org/anjocaido/groupmanager/GroupManager.java +++ b/EssentialsGroupManager/src/org/anjocaido/groupmanager/GroupManager.java @@ -202,7 +202,7 @@ public class GroupManager extends JavaPlugin { senderPlayer = (Player) sender; senderUser = worldsHolder.getWorldData(senderPlayer).getUser(senderPlayer.getName()); senderGroup = senderUser.getGroup(); - if (worldsHolder.getWorldPermissions(senderPlayer).has(senderPlayer, "groupmanager." + cmd.getName())) { + if (senderPlayer.isOp() || worldsHolder.getWorldPermissions(senderPlayer).has(senderPlayer, "groupmanager." + cmd.getName())) { playerCanDo = true; } } else if (sender instanceof ConsoleCommandSender) { @@ -300,7 +300,7 @@ public class GroupManager extends JavaPlugin { return false; } //VALIDANDO PERMISSAO - if (!isConsole && (senderGroup != null ? permissionHandler.inGroup(auxUser.getName(), senderGroup.getName()) : false)) { + if (!isConsole && !senderPlayer.isOp() && (senderGroup != null ? permissionHandler.inGroup(auxUser.getName(), senderGroup.getName()) : false)) { sender.sendMessage(ChatColor.RED + "Can't modify player with same permissions than you, or higher."); return false; } @@ -335,7 +335,7 @@ public class GroupManager extends JavaPlugin { auxUser = dataHolder.getUser(args[0]); } //VALIDANDO PERMISSAO - if (!isConsole && (senderGroup != null ? permissionHandler.inGroup(auxUser.getName(), senderGroup.getName()) : false)) { + if (!isConsole && !senderPlayer.isOp() && (senderGroup != null ? permissionHandler.inGroup(auxUser.getName(), senderGroup.getName()) : false)) { sender.sendMessage(ChatColor.RED + "Can't modify player with same permissions than you, or higher."); return false; } @@ -374,7 +374,7 @@ public class GroupManager extends JavaPlugin { return false; } //VALIDANDO PERMISSAO - if (!isConsole && (senderGroup != null ? permissionHandler.inGroup(auxUser.getName(), senderGroup.getName()) : false)) { + if (!isConsole && !senderPlayer.isOp() && (senderGroup != null ? permissionHandler.inGroup(auxUser.getName(), senderGroup.getName()) : false)) { sender.sendMessage(ChatColor.RED + "Can't modify player with same permissions than you, or higher."); return false; } @@ -408,7 +408,7 @@ public class GroupManager extends JavaPlugin { auxUser = dataHolder.getUser(args[0]); } //VALIDANDO PERMISSAO - if (!isConsole && (senderGroup != null ? permissionHandler.inGroup(auxUser.getName(), senderGroup.getName()) : false)) { + if (!isConsole && !senderPlayer.isOp() && (senderGroup != null ? permissionHandler.inGroup(auxUser.getName(), senderGroup.getName()) : false)) { sender.sendMessage(ChatColor.RED + "Can't modify player with same permissions than you, or higher."); return false; } @@ -491,7 +491,7 @@ public class GroupManager extends JavaPlugin { return false; } permissionResult = permissionHandler.checkFullUserPermission(senderUser, args[1]); - if (!isConsole && (permissionResult.resultType.equals(PermissionCheckResult.Type.NOTFOUND) + if (!isConsole && !senderPlayer.isOp() && (permissionResult.resultType.equals(PermissionCheckResult.Type.NOTFOUND) || permissionResult.resultType.equals(PermissionCheckResult.Type.NEGATION))) { sender.sendMessage(ChatColor.RED + "Can't add a permission you don't have."); return false; @@ -551,12 +551,12 @@ public class GroupManager extends JavaPlugin { auxUser = dataHolder.getUser(args[0]); } //VALIDANDO SUA PERMISSAO - if (!isConsole && (senderGroup != null ? permissionHandler.inGroup(auxUser.getName(), senderGroup.getName()) : false)) { + if (!isConsole && !senderPlayer.isOp() && (senderGroup != null ? permissionHandler.inGroup(auxUser.getName(), senderGroup.getName()) : false)) { sender.sendMessage(ChatColor.RED + "Can't modify player with same group than you, or higher."); return false; } permissionResult = permissionHandler.checkFullUserPermission(senderUser, args[1]); - if (!isConsole && (permissionResult.resultType.equals(PermissionCheckResult.Type.NOTFOUND) + if (!isConsole && !senderPlayer.isOp() && (permissionResult.resultType.equals(PermissionCheckResult.Type.NOTFOUND) || permissionResult.resultType.equals(PermissionCheckResult.Type.NEGATION))) { sender.sendMessage(ChatColor.RED + "Can't remove a permission you don't have."); return false; @@ -1458,23 +1458,23 @@ public class GroupManager extends JavaPlugin { return false; } //VALIDANDO PERMISSAO - if (!isConsole && (senderGroup != null ? permissionHandler.inGroup(auxUser.getName(), senderGroup.getName()) : false)) { + if (!isConsole && !senderPlayer.isOp() && (senderGroup != null ? permissionHandler.inGroup(auxUser.getName(), senderGroup.getName()) : false)) { sender.sendMessage(ChatColor.RED + "Can't modify player with same permissions than you, or higher."); return false; } - if (!isConsole && (permissionHandler.hasGroupInInheritance(auxGroup, senderGroup.getName()))) { + if (!isConsole && !senderPlayer.isOp() && (permissionHandler.hasGroupInInheritance(auxGroup, senderGroup.getName()))) { sender.sendMessage(ChatColor.RED + "The destination group can't be the same as yours, or higher."); return false; } - if (!isConsole && (!permissionHandler.inGroup(senderUser.getName(), auxUser.getGroupName()) || !permissionHandler.inGroup(senderUser.getName(), auxGroup.getName()))) { + if (!isConsole && !senderPlayer.isOp() && (!permissionHandler.inGroup(senderUser.getName(), auxUser.getGroupName()) || !permissionHandler.inGroup(senderUser.getName(), auxGroup.getName()))) { sender.sendMessage(ChatColor.RED + "Can't modify player involving a group that you don't inherit."); return false; } - if (!isConsole && (!permissionHandler.hasGroupInInheritance(auxUser.getGroup(), auxGroup.getName()) && !permissionHandler.hasGroupInInheritance(auxGroup, auxUser.getGroupName()))) { + if (!isConsole && !senderPlayer.isOp() && (!permissionHandler.hasGroupInInheritance(auxUser.getGroup(), auxGroup.getName()) && !permissionHandler.hasGroupInInheritance(auxGroup, auxUser.getGroupName()))) { sender.sendMessage(ChatColor.RED + "Can't modify player using groups with different heritage line."); return false; } - if (!isConsole && (!permissionHandler.hasGroupInInheritance(auxGroup, auxUser.getGroupName()))) { + if (!isConsole && !senderPlayer.isOp() && (!permissionHandler.hasGroupInInheritance(auxGroup, auxUser.getGroupName()))) { sender.sendMessage(ChatColor.RED + "The new group must be a higher rank."); return false; } @@ -1514,23 +1514,23 @@ public class GroupManager extends JavaPlugin { return false; } //VALIDANDO PERMISSAO - if (!isConsole && (senderGroup != null ? permissionHandler.inGroup(auxUser.getName(), senderGroup.getName()) : false)) { + if (!isConsole && !senderPlayer.isOp() && (senderGroup != null ? permissionHandler.inGroup(auxUser.getName(), senderGroup.getName()) : false)) { sender.sendMessage(ChatColor.RED + "Can't modify player with same permissions than you, or higher."); return false; } - if (!isConsole && (permissionHandler.hasGroupInInheritance(auxGroup, senderGroup.getName()))) { + if (!isConsole && !senderPlayer.isOp() && (permissionHandler.hasGroupInInheritance(auxGroup, senderGroup.getName()))) { sender.sendMessage(ChatColor.RED + "The destination group can't be the same as yours, or higher."); return false; } - if (!isConsole && (!permissionHandler.inGroup(senderUser.getName(), auxUser.getGroupName()) || !permissionHandler.inGroup(senderUser.getName(), auxGroup.getName()))) { + if (!isConsole && !senderPlayer.isOp() && (!permissionHandler.inGroup(senderUser.getName(), auxUser.getGroupName()) || !permissionHandler.inGroup(senderUser.getName(), auxGroup.getName()))) { sender.sendMessage(ChatColor.RED + "Can't modify player involving a group that you don' inherit."); return false; } - if (!isConsole && (!permissionHandler.hasGroupInInheritance(auxUser.getGroup(), auxGroup.getName()) && !permissionHandler.hasGroupInInheritance(auxGroup, auxUser.getGroupName()))) { + if (!isConsole && !senderPlayer.isOp() && (!permissionHandler.hasGroupInInheritance(auxUser.getGroup(), auxGroup.getName()) && !permissionHandler.hasGroupInInheritance(auxGroup, auxUser.getGroupName()))) { sender.sendMessage(ChatColor.RED + "Can't modify player using groups with different heritage line."); return false; } - if (!isConsole && (permissionHandler.hasGroupInInheritance(auxGroup, auxUser.getGroupName()))) { + if (!isConsole && !senderPlayer.isOp() && (permissionHandler.hasGroupInInheritance(auxGroup, auxUser.getGroupName()))) { sender.sendMessage(ChatColor.RED + "The new group must be a lower rank."); return false; } |