The code line I'm dealing with has to relate to take.php the following lines:
if (!$att->perm->can_take_session($pageparams->grouptype)) {
$group = groups_get_group($pageparams->grouptype);
throw new moodle_exception('cannottakeforgroup', 'attendance', '', $group->name);
But I'm not sure how to manipulate this to see the group of the requestor.