mirror of
https://github.com/moodle/moodle.git
synced 2025-04-04 16:04:00 +02:00
MDL-47728 tool_monitor: added capability check before displaying link
This commit is contained in:
parent
b49de5d930
commit
0b0a08e7b0
@ -56,7 +56,7 @@ function tool_monitor_extend_navigation_course($navigation, $course, $context) {
|
||||
*/
|
||||
function tool_monitor_extend_navigation_user_settings($navigation, $user, $usercontext, $course, $coursecontext) {
|
||||
global $USER;
|
||||
if (($USER->id == $user->id)) {
|
||||
if (($USER->id == $user->id) && (has_capability('tool/monitor:subscribe', $coursecontext))) {
|
||||
$url = new moodle_url('/admin/tool/monitor/index.php', array('courseid' => $course->id));
|
||||
$subsnode = navigation_node::create(get_string('managesubscriptions', 'tool_monitor'), $url,
|
||||
navigation_node::TYPE_SETTING, null, null, new pix_icon('i/settings', ''));
|
||||
|
Loading…
x
Reference in New Issue
Block a user