You are here

function lti_tool_provider_update_8101 in LTI Tool Provider 8

Same name and namespace in other branches
  1. 2.x lti_tool_provider.install \lti_tool_provider_update_8101()

Add missing LTI roles to config.

File

./lti_tool_provider.install, line 43
Installation and schema related functions for the LTI Tool Provider module.

Code

function lti_tool_provider_update_8101() {
  $config_factory = Drupal::configFactory();
  $config = $config_factory
    ->getEditable('lti_tool_provider.settings');
  $lti_roles = $config
    ->get('lti_roles');
  $lti_roles = array_merge([
    'urn:lti:sysrole:ims/lis/SysAdmin',
    'urn:lti:sysrole:ims/lis/SysSupport',
    'urn:lti:sysrole:ims/lis/Creator',
    'urn:lti:sysrole:ims/lis/AccountAdmin',
    'urn:lti:sysrole:ims/lis/User',
    'urn:lti:sysrole:ims/lis/Administrator',
    'urn:lti:sysrole:ims/lis/None',
    'urn:lti:instrole:ims/lis/Student',
    'urn:lti:instrole:ims/lis/Faculty',
    'urn:lti:instrole:ims/lis/Member',
    'urn:lti:instrole:ims/lis/Learner',
    'urn:lti:instrole:ims/lis/Instructor',
    'urn:lti:instrole:ims/lis/Mentor',
    'urn:lti:instrole:ims/lis/Staff',
    'urn:lti:instrole:ims/lis/Alumni',
    'urn:lti:instrole:ims/lis/ProspectiveStudent',
    'urn:lti:instrole:ims/lis/Guest',
    'urn:lti:instrole:ims/lis/Other',
    'urn:lti:instrole:ims/lis/Administrator',
    'urn:lti:instrole:ims/lis/Observer',
    'urn:lti:instrole:ims/lis/None',
  ], $lti_roles);
  $config
    ->set('lti_roles', $lti_roles);
  $config
    ->save(true);
}