From 5b19ecdca892fb23c14ea4eac06bdde421c66c58 Mon Sep 17 00:00:00 2001 From: ElgarL Date: Thu, 5 Jan 2012 19:43:30 +0000 Subject: Fix 'manucheckp' to correctly report if a permission is available from GroupManager or Bukkit. --- .../org/anjocaido/groupmanager/GroupManager.java | 40 +++++++++++----------- 1 file changed, 20 insertions(+), 20 deletions(-) (limited to 'EssentialsGroupManager/src/org') 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 -- cgit v1.2.3