1
0
mirror of https://github.com/essentials/Essentials.git synced 2025-09-26 06:09:15 +02:00

Prevent adding inheritances to globalgroups. These are permissions

collections, not player groups.
This commit is contained in:
ElgarL
2012-02-25 09:22:54 +00:00
parent 9c68cbae72
commit fa49fc91d2
3 changed files with 56 additions and 30 deletions

View File

@@ -1019,6 +1019,11 @@ public class GroupManager extends JavaPlugin {
sender.sendMessage(ChatColor.RED + "Group 2 does not exists!");
return false;
}
if (auxGroup.isGlobal()) {
sender.sendMessage(ChatColor.RED + "GlobalGroups do NOT support inheritance.");
return false;
}
// VALIDANDO PERMISSAO
if (permissionHandler.searchGroupInInheritance(auxGroup, auxGroup2.getName(), null)) {
sender.sendMessage(ChatColor.RED + "Group " + auxGroup.getName() + " already inherits " + auxGroup2.getName() + " (might not be directly)");
@@ -1052,6 +1057,11 @@ public class GroupManager extends JavaPlugin {
sender.sendMessage(ChatColor.RED + "Group 2 does not exists!");
return false;
}
if (auxGroup.isGlobal()) {
sender.sendMessage(ChatColor.RED + "GlobalGroups do NOT support inheritance.");
return false;
}
// VALIDANDO PERMISSAO
if (!permissionHandler.searchGroupInInheritance(auxGroup, auxGroup2.getName(), null)) {
sender.sendMessage(ChatColor.RED + "Group " + auxGroup.getName() + " does not inherits " + auxGroup2.getName() + ".");