added support to return a list of group memberships

The method name is a bit misleading. It appears as if we will get all group memberships this user is a part of, but we actually only get that set intersected with the ones that we want to restrict access on. Is that intended?