MDL-40857 External tool (LTI) capabilitiy names confusing.

I have improved the names in the language file so that they actually say
what they do (based on my reading of the code). I have also added
comments to access.php explaining each capability.

I have corrected a few of the RISK in access.php which were wrong.

I have changed a couple of the archetypes so that guests cannot launch
LTI activities, and editing teachers cannot do editing things.
This commit is contained in:
Tim Hunt 2013-07-24 12:42:33 +01:00
parent bdd045c5ec
commit c11ff4be69
2 changed files with 18 additions and 11 deletions

View File

@ -31,11 +31,11 @@ defined('MOODLE_INTERNAL') || die;
$capabilities = array(
// Whether the user can see the link to the external tool and follow it.
'mod/lti:view' => array(
'captype' => 'read',
'contextlevel' => CONTEXT_MODULE,
'archetypes' => array(
'guest' => CAP_ALLOW,
'student' => CAP_ALLOW,
'teacher' => CAP_ALLOW,
'editingteacher' => CAP_ALLOW,
@ -43,6 +43,7 @@ $capabilities = array(
)
),
// Add an External tool activity to a course.
'mod/lti:addinstance' => array(
'riskbitmask' => RISK_XSS,
@ -55,8 +56,10 @@ $capabilities = array(
'clonepermissionsfrom' => 'moodle/course:manageactivities'
),
// Controls access to the grade.php script, which shows all the submissions
// made to the external tool that have been reported back to Moodle.
'mod/lti:grade' => array(
'riskbitmask' => RISK_XSS,
'riskbitmask' => RISK_PERSONAL,
'captype' => 'write',
'contextlevel' => CONTEXT_MODULE,
@ -67,8 +70,11 @@ $capabilities = array(
)
),
// When the user arrives at the external tool, if they have this capability
// in Moodle, then they given the Instructor role in the remote system,
// otherwise they are given Learner. See the lti_get_ims_role function.
'mod/lti:manage' => array(
'riskbitmask' => RISK_XSS,
'riskbitmask' => RISK_PERSONAL, // A bit of a guess, but seems likely.
'captype' => 'write',
'contextlevel' => CONTEXT_MODULE,
@ -79,21 +85,22 @@ $capabilities = array(
)
),
// The ability to create or edit tool configurations for particular courses.
'mod/lti:addcoursetool' => array(
'captype' => 'write',
'contextlevel' => CONTEXT_COURSE,
'archetypes' => array(
'teacher' => CAP_ALLOW,
'editingteacher' => CAP_ALLOW,
'manager' => CAP_ALLOW
)
),
// The ability to request the adminstirator to configure a particular
// External tool globally.
'mod/lti:requesttooladd' => array(
'captype' => 'write',
'contextlevel' => CONTEXT_COURSE,
'archetypes' => array(
'teacher' => CAP_ALLOW,
'editingteacher' => CAP_ALLOW,
'manager' => CAP_ALLOW
)

View File

@ -216,12 +216,12 @@ real estate to the tool, and others provide a more integrated feel with the Mood
It is possible that browsers will prevent the new window from opening.';
$string['launchoptions'] = 'Launch Options';
$string['lti'] = 'LTI';
$string['lti:addinstance'] = 'Add a new LTI activity';
$string['lti:addcoursetool'] = 'Grade LTI activities';
$string['lti:grade'] = 'Grade LTI activities';
$string['lti:manage'] = 'Edit LTI activities';
$string['lti:requesttooladd'] = 'Submit a tool to admins for configuration';
$string['lti:view'] = 'View LTI activities';
$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:requesttooladd'] = 'Request a tool is configured site-wide';
$string['lti:view'] = 'Launch external tool activities';
$string['lti_administration'] = 'LTI Administration';
$string['lti_errormsg'] = 'The tool returned the following error message: "{$a}"';
$string['lti_launch_error'] = 'An error occured when launching the external tool: ';