mirror of
https://github.com/EssentialsX/Essentials.git
synced 2024-11-09 04:20:42 +01:00
Warn when adding a node where an exception already exist.
This commit is contained in:
parent
5f5a9adf31
commit
9f13653be6
@ -217,3 +217,4 @@ v 2.0:
|
||||
- '/manselect' will no longer list duplicate worlds.
|
||||
- Added a new mirroring option in the config of 'all_unnamed_worlds'. This will cause all new or unnamed worlds to use this mirroring.
|
||||
- Don't allow adding a node with '/manuaddp' and '/mangaddp' which is already negated.
|
||||
- Warn when adding a node where an exception already exist.
|
@ -750,7 +750,7 @@ public class GroupManager extends JavaPlugin {
|
||||
if (permissionResult.resultType.equals(PermissionCheckResult.Type.EXCEPTION)) {
|
||||
sender.sendMessage(ChatColor.RED + "The user already has direct access to that permission.");
|
||||
sender.sendMessage(ChatColor.RED + "Node: " + permissionResult.accessLevel);
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
} else if (auxString.startsWith("-")) {
|
||||
if (permissionResult.resultType.equals(PermissionCheckResult.Type.EXCEPTION)) {
|
||||
@ -758,19 +758,23 @@ public class GroupManager extends JavaPlugin {
|
||||
sender.sendMessage(ChatColor.RED + "Node: " + permissionResult.accessLevel);
|
||||
return true;
|
||||
} else if (permissionResult.resultType.equals(PermissionCheckResult.Type.NEGATION)) {
|
||||
sender.sendMessage(ChatColor.RED + "The user already has a matching node ");
|
||||
sender.sendMessage(ChatColor.RED + "The user already has a matching node.");
|
||||
sender.sendMessage(ChatColor.RED + "Node: " + permissionResult.accessLevel);
|
||||
return true;
|
||||
}
|
||||
} else {
|
||||
if (permissionResult.resultType.equals(PermissionCheckResult.Type.FOUND)) {
|
||||
if (permissionResult.resultType.equals(PermissionCheckResult.Type.EXCEPTION)) {
|
||||
// Warn only while still allowing you to add the node.
|
||||
sender.sendMessage(ChatColor.RED + "The user already has an exception for this node.");
|
||||
sender.sendMessage(ChatColor.RED + "Node: " + permissionResult.accessLevel);
|
||||
} else if (permissionResult.resultType.equals(PermissionCheckResult.Type.FOUND)) {
|
||||
sender.sendMessage(ChatColor.RED + "The user already has direct access to that permission.");
|
||||
sender.sendMessage(ChatColor.RED + "Node: " + permissionResult.accessLevel);
|
||||
return true;
|
||||
} else if (permissionResult.resultType.equals(PermissionCheckResult.Type.NEGATION)) {
|
||||
sender.sendMessage(ChatColor.RED + "The user already has a matching Negated node ");
|
||||
// Warn only while still allowing you to add the node.
|
||||
sender.sendMessage(ChatColor.RED + "The user already has a matching Negated node.");
|
||||
sender.sendMessage(ChatColor.RED + "Node: " + permissionResult.accessLevel);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
// Seems OK
|
||||
@ -1015,14 +1019,18 @@ public class GroupManager extends JavaPlugin {
|
||||
return true;
|
||||
}
|
||||
} else {
|
||||
if (permissionResult.resultType.equals(PermissionCheckResult.Type.FOUND)) {
|
||||
if (permissionResult.resultType.equals(PermissionCheckResult.Type.EXCEPTION)) {
|
||||
// Warn only while still allowing you to add the node.
|
||||
sender.sendMessage(ChatColor.RED + "The group already has an exception for this node.");
|
||||
sender.sendMessage(ChatColor.RED + "Node: " + permissionResult.accessLevel);
|
||||
} else if (permissionResult.resultType.equals(PermissionCheckResult.Type.FOUND)) {
|
||||
sender.sendMessage(ChatColor.RED + "The group already has direct access to that permission.");
|
||||
sender.sendMessage(ChatColor.RED + "Node: " + permissionResult.accessLevel);
|
||||
return true;
|
||||
} else if (permissionResult.resultType.equals(PermissionCheckResult.Type.NEGATION)) {
|
||||
sender.sendMessage(ChatColor.RED + "The group already has a matching Negated node ");
|
||||
// Warn only while still allowing you to add the node.
|
||||
sender.sendMessage(ChatColor.RED + "The group already has a matching Negated node.");
|
||||
sender.sendMessage(ChatColor.RED + "Node: " + permissionResult.accessLevel);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
// Seems OK
|
||||
|
Loading…
Reference in New Issue
Block a user