Permalink
Browse files

Merge branch 'lti_admin' of https://github.com/baholladay/moodle

  • Loading branch information...
dmonllao committed Jul 10, 2017
2 parents 4b0518a + 1aa11df commit 7fd09e2471edd97eec371a2fa8ff500284333290
Showing with 15 additions and 2 deletions.
  1. +10 −0 mod/lti/db/access.php
  2. +1 −0 mod/lti/lang/en/lti.php
  3. +3 −1 mod/lti/locallib.php
  4. +1 −1 mod/lti/version.php
@@ -71,6 +71,16 @@
)
),
// When the user arrives at the external tool, if they have this capability
// in Moodle, then they are given the Administrator role in the remote system,
// otherwise they are given Learner. See the lti_get_ims_role function.
'mod/lti:admin' => array(
'riskbitmask' => RISK_PERSONAL, // A bit of a guess, but seems likely.
'captype' => 'write',
'contextlevel' => CONTEXT_MODULE
),
// The ability to create or edit tool configurations for particular courses.
'mod/lti:addcoursetool' => array(
'captype' => 'write',
@@ -243,6 +243,7 @@
$string['lti:addcoursetool'] = 'Add course-specific tool configurations';
$string['lti:grade'] = 'View grades returned by the external tool';
$string['lti:manage'] = 'Be an Instructor when the tool is launched';
$string['lti:admin'] = 'Be an Admininstrator when the tool is launched';
$string['lti:requesttooladd'] = 'Request a tool is configured site-wide';
$string['lti:view'] = 'Launch external tool activities';
$string['ltisettings'] = 'LTI settings';
@@ -1319,7 +1319,9 @@ function lti_get_ims_role($user, $cmid, $courseid, $islti2) {
}
}
if (is_siteadmin($user)) {
if (is_siteadmin($user) || has_capability('mod/lti:admin', $context)) {
// Make sure admins do not have the Learner role, then set admin role.
$roles = array_diff($roles, array('Learner'));
if (!$islti2) {
array_push($roles, 'urn:lti:sysrole:ims/lis/Administrator', 'urn:lti:instrole:ims/lis/Administrator');
} else {
@@ -48,7 +48,7 @@
defined('MOODLE_INTERNAL') || die;
$plugin->version = 2017051500; // The current module version (Date: YYYYMMDDXX).
$plugin->version = 2017051600; // The current module version (Date: YYYYMMDDXX).
$plugin->requires = 2017050500; // Requires this Moodle version.
$plugin->component = 'mod_lti'; // Full name of the plugin (used for diagnostics).
$plugin->cron = 0;

0 comments on commit 7fd09e2

Please sign in to comment.