How to return a user's group access permissions? I am trying to block a user from accessing certain content/blocks if they do not have permission to view content of a certain type within a group.

I have the user ID and the group ID, but how do I check the user's permissions for that group? I can't find any documentation. 

To start, how would I print all the permissions for a given user and group?
The Group class has a userHasPermission() method you can use. So something like this:

if ($group-&gt;userHasPermission($user-&gt;uid, 'some permission')) {
  // do something.
}