Raised bukkit perms priority

This commit is contained in:
ElgarL 2011-11-25 16:01:46 +00:00
parent 24a6073488
commit b41c3709ba

View file

@ -669,7 +669,7 @@ public class AnjoPermissionsHandler extends PermissionsReaderInterface {
* @return true if permission was found. false if not, or was negated. * @return true if permission was found. false if not, or was negated.
*/ */
public boolean checkUserPermission(User user, String permission) { public boolean checkUserPermission(User user, String permission) {
PermissionCheckResult result = checkFullUserPermission(user, permission); PermissionCheckResult result = checkFullGMPermission(user, permission, true);
if (result.resultType.equals(PermissionCheckResult.Type.EXCEPTION) || result.resultType.equals(PermissionCheckResult.Type.FOUND)) { if (result.resultType.equals(PermissionCheckResult.Type.EXCEPTION) || result.resultType.equals(PermissionCheckResult.Type.FOUND)) {
return true; return true;
} }
@ -708,6 +708,16 @@ public class AnjoPermissionsHandler extends PermissionsReaderInterface {
return result; return result;
} }
if (checkBukkit == true) {
// Check Bukkit perms to support plugins which add perms via code (Heroes).
final Player player = Bukkit.getPlayer(user.getName());
if ((player != null) && (player.hasPermission(targetPermission))) {
result.resultType = PermissionCheckResult.Type.FOUND;
result.owner = user;
return result;
}
}
PermissionCheckResult resultUser = checkUserOnlyPermission(user, targetPermission); PermissionCheckResult resultUser = checkUserOnlyPermission(user, targetPermission);
if (!resultUser.resultType.equals(PermissionCheckResult.Type.NOTFOUND)) { if (!resultUser.resultType.equals(PermissionCheckResult.Type.NOTFOUND)) {
return resultUser; return resultUser;
@ -727,16 +737,6 @@ public class AnjoPermissionsHandler extends PermissionsReaderInterface {
} }
} }
if (checkBukkit == true) {
// Check Bukkit perms to support plugins which add perms via code (Heroes).
final Player player = Bukkit.getPlayer(user.getName());
if ((player != null) && (player.hasPermission(targetPermission))) {
result.resultType = PermissionCheckResult.Type.FOUND;
result.owner = user;
return result;
}
}
// THEN IT RETURNS A NOT FOUND // THEN IT RETURNS A NOT FOUND
return result; return result;
} }