Merge branch 'lti_admin' of https://github.com/baholladay/moodle
This commit is contained in:
@@ -71,6 +71,16 @@ $capabilities = array(
|
||||
)
|
||||
),
|
||||
|
||||
// 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:addinstance'] = 'Add new external tool activities';
|
||||
$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 {
|
||||
|
||||
+1
-1
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user