MDL-62599 lti_gradebookservices: use correct key in get_permitted_scopes

This was missing from the revert commit, a464331db2594c, causing scopes
to be empty.
This commit is contained in:
Jake Dallimore 2019-05-08 09:28:23 +08:00
parent 5c73f6e2e5
commit 7b3297d298

View File

@ -97,8 +97,8 @@ class gradebookservices extends service_base {
$scopes = array();
$ok = !empty($this->get_type());
if ($ok && isset($this->get_typeconfig()[$this->get_component_id()])) {
if (!empty($setting = $this->get_typeconfig()[$this->get_component_id()])) {
if ($ok && isset($this->get_typeconfig()['ltiservice_gradesynchronization'])) {
if (!empty($setting = $this->get_typeconfig()['ltiservice_gradesynchronization'])) {
$scopes[] = self::SCOPE_GRADEBOOKSERVICES_LINEITEM_READ;
$scopes[] = self::SCOPE_GRADEBOOKSERVICES_RESULT_READ;
$scopes[] = self::SCOPE_GRADEBOOKSERVICES_SCORE;