summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorElgarL <ElgarL@palmergames.com>2012-01-05 19:43:30 +0000
committerElgarL <ElgarL@palmergames.com>2012-01-05 19:43:30 +0000
commit4c485f31476825993ba8edac00a71080d51d6a2d (patch)
treeaeb0c0d0a6b91aefb6107d47bfc98a3526b97599
parent7726fd0081346b59e4c555476f6c62e1aa38b69f (diff)
downloadEssentials-4c485f31476825993ba8edac00a71080d51d6a2d.tar
Essentials-4c485f31476825993ba8edac00a71080d51d6a2d.tar.gz
Essentials-4c485f31476825993ba8edac00a71080d51d6a2d.tar.lz
Essentials-4c485f31476825993ba8edac00a71080d51d6a2d.tar.xz
Essentials-4c485f31476825993ba8edac00a71080d51d6a2d.zip
Fix 'manucheckp' to correctly report if a permission is available from
GroupManager or Bukkit.
-rw-r--r--EssentialsGroupManager/src/Changelog.txt3
-rw-r--r--EssentialsGroupManager/src/org/anjocaido/groupmanager/GroupManager.java40
2 files changed, 22 insertions, 21 deletions
diff --git a/EssentialsGroupManager/src/Changelog.txt b/EssentialsGroupManager/src/Changelog.txt
index 9b43fddbb..8e4996b01 100644
--- a/EssentialsGroupManager/src/Changelog.txt
+++ b/EssentialsGroupManager/src/Changelog.txt
@@ -95,4 +95,5 @@ v 1.8:
- Delayed GroupManager events so Superperms will be fully updated before plugins receive the events.
- Changed the way events are raised to prevent variable corruption.
- Reload GlobalGroups when you perform a world load.
- - Changed GlobalGroups to save/load before local groups in the scheduled data saving/loading \ No newline at end of file
+ - Changed GlobalGroups to save/load before local groups in the scheduled data saving/loading
+ - Fix 'manucheckp' to correctly report if a permission is available from GroupManager or Bukkit. \ 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 16e0222d8..4ba2624bf 100644
--- a/EssentialsGroupManager/src/org/anjocaido/groupmanager/GroupManager.java
+++ b/EssentialsGroupManager/src/org/anjocaido/groupmanager/GroupManager.java
@@ -787,29 +787,29 @@ public class GroupManager extends JavaPlugin {
}
targetPlayer = this.getServer().getPlayer(auxUser.getName());
// VALIDANDO PERMISSAO
- permissionResult = permissionHandler.checkFullUserPermission(auxUser, args[1]);
+ permissionResult = permissionHandler.checkFullGMPermission(auxUser, args[1], false);
+
if (permissionResult.resultType.equals(PermissionCheckResult.Type.NOTFOUND)) {
+ //No permissions found in GM so fall through and check Bukkit.
sender.sendMessage(ChatColor.RED + "The player doesn't have access to that permission");
- sender.sendMessage(ChatColor.YELLOW + "SuperPerms reports Node: " + targetPlayer.hasPermission(args[1]));
- return false;
- }
- // PARECE OK
- // auxString =
- // permissionHandler.checkUserOnlyPermission(auxUser, args[1]);
- if (permissionResult.owner instanceof User) {
- if (permissionResult.resultType.equals(PermissionCheckResult.Type.NEGATION)) {
- sender.sendMessage(ChatColor.RED + "The user has directly a negation node for that permission.");
- } else {
- sender.sendMessage(ChatColor.YELLOW + "The user has directly this permission.");
- }
- sender.sendMessage(ChatColor.YELLOW + "Permission Node: " + permissionResult.accessLevel);
- } else if (permissionResult.owner instanceof Group) {
- if (permissionResult.resultType.equals(PermissionCheckResult.Type.NEGATION)) {
- sender.sendMessage(ChatColor.RED + "The user inherits a negation permission from group: " + permissionResult.owner.getName());
- } else {
- sender.sendMessage(ChatColor.YELLOW + "The user inherits the permission from group: " + permissionResult.owner.getName());
+
+ } else {
+ // This permission was found in groupmanager.
+ if (permissionResult.owner instanceof User) {
+ if (permissionResult.resultType.equals(PermissionCheckResult.Type.NEGATION)) {
+ sender.sendMessage(ChatColor.RED + "The user has directly a negation node for that permission.");
+ } else {
+ sender.sendMessage(ChatColor.YELLOW + "The user has directly this permission.");
+ }
+ sender.sendMessage(ChatColor.YELLOW + "Permission Node: " + permissionResult.accessLevel);
+ } else if (permissionResult.owner instanceof Group) {
+ if (permissionResult.resultType.equals(PermissionCheckResult.Type.NEGATION)) {
+ sender.sendMessage(ChatColor.RED + "The user inherits a negation permission from group: " + permissionResult.owner.getName());
+ } else {
+ sender.sendMessage(ChatColor.YELLOW + "The user inherits the permission from group: " + permissionResult.owner.getName());
+ }
+ sender.sendMessage(ChatColor.YELLOW + "Permission Node: " + permissionResult.accessLevel);
}
- sender.sendMessage(ChatColor.YELLOW + "Permission Node: " + permissionResult.accessLevel);
}
// superperms