MDL-14627 new mod/url:view capability
This commit is contained in:
@@ -27,6 +27,15 @@
|
||||
defined('MOODLE_INTERNAL') || die;
|
||||
|
||||
$capabilities = array(
|
||||
'mod/url:view' => array(
|
||||
'captype' => 'read',
|
||||
'contextlevel' => CONTEXT_MODULE,
|
||||
'archetypes' => array(
|
||||
'guest' => CAP_ALLOW,
|
||||
'user' => CAP_ALLOW,
|
||||
)
|
||||
),
|
||||
|
||||
/* TODO: review public portfolio API first!
|
||||
'mod/url:portfolioexport' => array(
|
||||
|
||||
|
||||
@@ -63,3 +63,4 @@ $string['printintro'] = 'Display URL description';
|
||||
$string['printintroexplain'] = 'Display URL description bellow content? Some display types may not display description even if enabled.';
|
||||
$string['rolesinparams'] = 'Include role names in parameters';
|
||||
$string['serverurl'] = 'Server URL';
|
||||
$string['url:view'] = 'View URL';
|
||||
|
||||
+1
-1
@@ -26,7 +26,7 @@
|
||||
|
||||
defined('MOODLE_INTERNAL') || die;
|
||||
|
||||
$module->version = 2010080300;
|
||||
$module->version = 2010101400;
|
||||
$module->requires = 2010080300; // Requires this Moodle version
|
||||
$module->cron = 0;
|
||||
|
||||
|
||||
@@ -45,6 +45,7 @@ $course = $DB->get_record('course', array('id'=>$cm->course), '*', MUST_EXIST);
|
||||
|
||||
require_course_login($course, true, $cm);
|
||||
$context = get_context_instance(CONTEXT_MODULE, $cm->id);
|
||||
require_capability('mod/url:view', $context);
|
||||
|
||||
add_to_log($course->id, 'url', 'view', 'view.php?id='.$cm->id, $url->id, $cm->id);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user