MDL-47728 tool_monitor: added capability check before displaying link

This commit is contained in:
Mark Nelson 2014-10-18 20:15:35 -07:00
parent b49de5d930
commit 0b0a08e7b0

View File

@ -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', ''));