mirror of
https://github.com/moodle/moodle.git
synced 2025-08-04 08:26:37 +02:00
MDL-74344 comment: consistent capability check for accessing report.
Co-authored-by: David Wipperfurth <dwipperfurth@webcourseworks.com>
This commit is contained in:
parent
b8e9cb31e9
commit
590088f118
2 changed files with 4 additions and 4 deletions
|
@ -492,7 +492,10 @@ if ($hassiteconfig && !empty($CFG->enableplagiarism)) {
|
||||||
$plugin->load_settings($ADMIN, 'plagiarism', $hassiteconfig);
|
$plugin->load_settings($ADMIN, 'plagiarism', $hassiteconfig);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$ADMIN->add('reports', new admin_externalpage('comments', new lang_string('comments'), $CFG->wwwroot.'/comment/', 'moodle/site:viewreports'));
|
|
||||||
|
// Comments report, note this page is really just a means to delete comments so check that.
|
||||||
|
$ADMIN->add('reports', new admin_externalpage('comments', new lang_string('comments'), $CFG->wwwroot . '/comment/index.php',
|
||||||
|
'moodle/comment:delete'));
|
||||||
|
|
||||||
// Course reports settings
|
// Course reports settings
|
||||||
if ($hassiteconfig) {
|
if ($hassiteconfig) {
|
||||||
|
|
|
@ -28,9 +28,6 @@ require_once($CFG->dirroot.'/comment/locallib.php');
|
||||||
|
|
||||||
admin_externalpage_setup('comments', '', null, '', array('pagelayout'=>'report'));
|
admin_externalpage_setup('comments', '', null, '', array('pagelayout'=>'report'));
|
||||||
|
|
||||||
$context = context_system::instance();
|
|
||||||
require_capability('moodle/comment:delete', $context);
|
|
||||||
|
|
||||||
$PAGE->requires->js_init_call('M.core_comment.init_admin', null, true);
|
$PAGE->requires->js_init_call('M.core_comment.init_admin', null, true);
|
||||||
|
|
||||||
$action = optional_param('action', '', PARAM_ALPHA);
|
$action = optional_param('action', '', PARAM_ALPHA);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue