Prevent promoting players to, and demoting to GlobalGroups.

This commit is contained in:
ElgarL 2012-02-25 09:29:54 +00:00
parent fa49fc91d2
commit 50bd5869bf
2 changed files with 30 additions and 1 deletions

View file

@ -144,4 +144,5 @@ v 1.9:
- A command of '/manload' with no world arguments now performs a full reload of GM.
- Update for Bukkit R5 compatability.
- Removed BukkitPermsOverride as this is now the default with bukkit handling child nodes.
- Prevent adding inheritances to globalgroups. These are permissions collections, not player groups.
- Prevent adding inheritances and info nodes to globalgroups. These are permissions collections, not player groups.
- Prevent promoting players to, and demoting to GlobalGroups.

View file

@ -398,6 +398,10 @@ public class GroupManager extends JavaPlugin {
sender.sendMessage(ChatColor.RED + "Group not found!");
return false;
}
if (auxGroup.isGlobal()) {
sender.sendMessage(ChatColor.RED + "Players may not be members of GlobalGroups directly.");
return false;
}
// VALIDANDO PERMISSAO
if (!isConsole && !isOpOverride && (senderGroup != null ? permissionHandler.inGroup(auxUser.getName(), senderGroup.getName()) : false)) {
@ -1232,6 +1236,10 @@ public class GroupManager extends JavaPlugin {
sender.sendMessage(ChatColor.RED + "Group does not exists!");
return false;
}
if (auxGroup.isGlobal()) {
sender.sendMessage(ChatColor.RED + "GlobalGroups do NOT support Info Nodes.");
return false;
}
// VALIDANDO PERMISSAO
// PARECE OK
auxString = "";
@ -1261,6 +1269,10 @@ public class GroupManager extends JavaPlugin {
sender.sendMessage(ChatColor.RED + "Group does not exists!");
return false;
}
if (auxGroup.isGlobal()) {
sender.sendMessage(ChatColor.RED + "GlobalGroups do NOT support Info Nodes.");
return false;
}
// VALIDANDO PERMISSAO
if (!auxGroup.getVariables().hasVar(args[1])) {
sender.sendMessage(ChatColor.RED + "The group doesn't have directly that variable!");
@ -1286,6 +1298,10 @@ public class GroupManager extends JavaPlugin {
sender.sendMessage(ChatColor.RED + "Group does not exists!");
return false;
}
if (auxGroup.isGlobal()) {
sender.sendMessage(ChatColor.RED + "GlobalGroups do NOT support Info Nodes.");
return false;
}
// VALIDANDO PERMISSAO
// PARECE OK
auxString = "";
@ -1323,6 +1339,10 @@ public class GroupManager extends JavaPlugin {
sender.sendMessage(ChatColor.RED + "Group does not exists!");
return false;
}
if (auxGroup.isGlobal()) {
sender.sendMessage(ChatColor.RED + "GlobalGroups do NOT support Info Nodes.");
return false;
}
// VALIDANDO PERMISSAO
auxGroup2 = permissionHandler.nextGroupWithVariable(auxGroup, args[1], null);
if (auxGroup2 == null) {
@ -1588,6 +1608,10 @@ public class GroupManager extends JavaPlugin {
sender.sendMessage(ChatColor.RED + "Group not found!");
return false;
}
if (auxGroup.isGlobal()) {
sender.sendMessage(ChatColor.RED + "Players may not be members of GlobalGroups directly.");
return false;
}
// VALIDANDO PERMISSAO
if (!isConsole && !isOpOverride && (senderGroup != null ? permissionHandler.inGroup(auxUser.getName(), senderGroup.getName()) : false)) {
sender.sendMessage(ChatColor.RED + "Can't modify player with same permissions than you, or higher.");
@ -1644,6 +1668,10 @@ public class GroupManager extends JavaPlugin {
sender.sendMessage(ChatColor.RED + "Group not found!");
return false;
}
if (auxGroup.isGlobal()) {
sender.sendMessage(ChatColor.RED + "Players may not be members of GlobalGroups directly.");
return false;
}
// VALIDANDO PERMISSAO
if (!isConsole && !isOpOverride && (senderGroup != null ? permissionHandler.inGroup(auxUser.getName(), senderGroup.getName()) : false)) {
sender.sendMessage(ChatColor.RED + "Can't modify player with same permissions than you, or higher.");