summaryrefslogtreecommitdiffstats
path: root/EssentialsGroupManager
diff options
context:
space:
mode:
authorsnowleo <snowleo@e251c2fe-e539-e718-e476-b85c1f46cddb>2011-05-13 17:36:41 +0000
committersnowleo <snowleo@e251c2fe-e539-e718-e476-b85c1f46cddb>2011-05-13 17:36:41 +0000
commit6c42f420053768dff072e7be18e1b33da18e1dd0 (patch)
treefa932cfb1d419ee85ba93af8608c53da5b2d8d9a /EssentialsGroupManager
parentea15ea0995749b228dc288b88c466f62df94c952 (diff)
downloadEssentials-6c42f420053768dff072e7be18e1b33da18e1dd0.tar
Essentials-6c42f420053768dff072e7be18e1b33da18e1dd0.tar.gz
Essentials-6c42f420053768dff072e7be18e1b33da18e1dd0.tar.lz
Essentials-6c42f420053768dff072e7be18e1b33da18e1dd0.tar.xz
Essentials-6c42f420053768dff072e7be18e1b33da18e1dd0.zip
Op users now have access to all GroupManager commands.
git-svn-id: https://svn.java.net/svn/essentials~svn/trunk@1435 e251c2fe-e539-e718-e476-b85c1f46cddb
Diffstat (limited to 'EssentialsGroupManager')
-rw-r--r--EssentialsGroupManager/src/org/anjocaido/groupmanager/GroupManager.java36
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;
}