MDL-59977 core: do not directly check 'viewparticipant' capability
This commit is contained in:
+2
-3
@@ -17,6 +17,7 @@
|
||||
require_once('../config.php');
|
||||
require_once('lib.php');
|
||||
require_once('edit_form.php');
|
||||
require_once($CFG->dirroot . '/course/lib.php');
|
||||
|
||||
$noteid = optional_param('id', 0, PARAM_INT);
|
||||
|
||||
@@ -95,9 +96,7 @@ if ($noteid) {
|
||||
|
||||
// Output HTML.
|
||||
$link = null;
|
||||
if (has_capability('moodle/course:viewparticipants', $context)
|
||||
|| has_capability('moodle/site:viewparticipants', context_system::instance())) {
|
||||
|
||||
if (course_can_view_participants($context) || course_can_view_participants(context_system::instance())) {
|
||||
$link = new moodle_url('/user/index.php', array('id' => $course->id));
|
||||
}
|
||||
$PAGE->navbar->add(get_string('participants'), $link);
|
||||
|
||||
Reference in New Issue
Block a user