#872 Use Player#hasPermission instead of custom PermissionHandler method

- Use Player#hasPermission to check if a player has a permission
- Remove hasPermission method from PermissionHandler implementations
This commit is contained in:
ljacqu
2016-08-31 21:27:43 +02:00
parent b07e60a807
commit dd27ff7daa
8 changed files with 2 additions and 48 deletions
@@ -198,13 +198,13 @@ public class PermissionsManager implements Reloadable {
return true;
}
// Return if the player is an Op if sender is console or no permission system in use
// Return default if sender is not a player or no permission system is in use
if (!(sender instanceof Player) || !isEnabled()) {
return permissionNode.getDefaultPermission().evaluate(sender);
}
Player player = (Player) sender;
return handler.hasPermission(player, permissionNode);
return player.hasPermission(permissionNode.getNode());
}
/**