summaryrefslogtreecommitdiffstats
path: root/EssentialsGroupManager
diff options
context:
space:
mode:
authorElgarL <ElgarL@palmergames.com>2013-02-25 10:46:16 +0000
committerElgarL <ElgarL@palmergames.com>2013-02-25 10:46:16 +0000
commitaceea11885133ed0dd1c371d1011ab9d1ce16b25 (patch)
treed4f41a539f663edf6560fd020e8cb7252eeada69 /EssentialsGroupManager
parentaa58ebc63e3f1053ed0e756f230b26cae7bcd163 (diff)
downloadEssentials-aceea11885133ed0dd1c371d1011ab9d1ce16b25.tar
Essentials-aceea11885133ed0dd1c371d1011ab9d1ce16b25.tar.gz
Essentials-aceea11885133ed0dd1c371d1011ab9d1ce16b25.tar.lz
Essentials-aceea11885133ed0dd1c371d1011ab9d1ce16b25.tar.xz
Essentials-aceea11885133ed0dd1c371d1011ab9d1ce16b25.zip
Warn when adding a node where an exception already exist.
Diffstat (limited to 'EssentialsGroupManager')
-rw-r--r--EssentialsGroupManager/src/Changelog.txt3
-rw-r--r--EssentialsGroupManager/src/org/anjocaido/groupmanager/GroupManager.java24
2 files changed, 18 insertions, 9 deletions
diff --git a/EssentialsGroupManager/src/Changelog.txt b/EssentialsGroupManager/src/Changelog.txt
index 6226484d7..75d506396 100644
--- a/EssentialsGroupManager/src/Changelog.txt
+++ b/EssentialsGroupManager/src/Changelog.txt
@@ -216,4 +216,5 @@ v 2.0:
- Catch the error when using an out of date config for 'allow_commandblocks' So it doesn't kill the whole config.
- '/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. \ No newline at end of file
+ - Don't allow adding a node with '/manuaddp' and '/mangaddp' which is already negated.
+ - Warn when adding a node where an exception already exist. \ No newline at end of file
diff --git a/EssentialsGroupManager/src/org/anjocaido/groupmanager/GroupManager.java b/EssentialsGroupManager/src/org/anjocaido/groupmanager/GroupManager.java
index bf9e49300..74d39ecae 100644
--- a/EssentialsGroupManager/src/org/anjocaido/groupmanager/GroupManager.java
+++ b/EssentialsGroupManager/src/org/anjocaido/groupmanager/GroupManager.java
@@ -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