Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion local/o365/classes/feature/cohortsync/main.php
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,7 @@ public function get_group_owners_and_members(string $groupoid) {
}

try {
$memberrecords = $this->graphclient->get_group_members($groupoid);
$memberrecords = $this->graphclient->get_transitive_group_members($groupoid);
$ownerrecords = $this->graphclient->get_group_owners($groupoid);
} catch (moodle_exception $e) {
if (strpos($e->getMessage(), utils::RESOURCE_NOT_EXIST_ERROR) !== false) {
Expand Down
13 changes: 13 additions & 0 deletions local/o365/classes/rest/unified.php
Original file line number Diff line number Diff line change
Expand Up @@ -613,6 +613,19 @@ public function get_group_members(string $groupobjectid): array {
return $this->paginatedapicall('get', $endpoint);
}

/**
* Get a list of transitive group members.
*
* @param string $groupobjectid The object ID of the group.
* @return array Array of returned members.
* @throws moodle_exception
*/
public function get_transitive_group_members(string $groupobjectid): array {
$endpoint = '/groups/' . $groupobjectid . '/transitiveMembers';

return $this->paginatedapicall('get', $endpoint);
}

/**
* Get a list of group owners.
*
Expand Down
Loading