Check permission from UserID
I know I can check if the current user is an admin using something like
$IsAdmin = Gdn::Session()->CheckPermission('Garden.Users.Edit');
Can I perform a similar check based on a UserID rather than the active session? I am writing a plugin that assigns different avatars based on user roles. The issue I have at the moment is getting the right image to show when I visit a users profile page (at the moment it shows the image for the logged on user rather than the profile I am visiting).
This is in Vanilla 2.1.3