-
Notifications
You must be signed in to change notification settings - Fork 109
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Check a task's necessary scopes prior to API calls #621
Comments
Investigate:
|
Ideas: $reportscopes = [
'classic' => [
'report:read:admin',
],
'granular' => [
'report:read:list_' . $meetingtypesingular . '_participants:admin',
],
];
private function get_scope_type($scopes) {
return in_array('meeting:read:admin', $scopes, true) ? 'classic' : 'granular';
}
$this->scopetype = $this->get_scope_type($this->scopes);
$missingscopes = array_diff($requiredscopes[$this->scopetype], $scopes); |
From #614, we should check the necessary scopes for a task before we make API calls that will fail (especially if it's going to fail silently). This will allow us to use
mtrace()
or similar to provide information to the Moodle server administrators if they are trying to figure out why a task is not working as expected. Because recording/reports/etc scopes are technically optional, this will allow us to let them know if a task is running that has not been granted the scopes for that task to function/provide value.The text was updated successfully, but these errors were encountered: