I think you could call fetch_userinfo() then fetch_permissions() (both in includes/functions.php). Maybe something like:
PHP Code:
$check_user = fetch_userinfo($userid);
$check_permissions = fetch_permissions(0, $userid, $check_user, false);
then use $check_permissions like you do for the current user. I haven't tried it though, I just looked up these functions.
For fetch_permissions(), the first parameter is a forumid, in case you want to check permissions for a specific forum. And the last parameter tells it whether or not you need the calendar permissions for the user.