MDL-64820 forum: Correct capability check and redir

This commit is contained in:
Andrew Nicols 2019-03-25 09:36:49 +08:00
parent e5a501de13
commit 7aa6affa49

View File

@ -85,14 +85,16 @@ if (empty($cm->visible) && !has_capability('moodle/course:viewhiddenactivities',
redirect(
$urlfactory->get_course_url_from_forum($forum),
get_string('activityiscurrentlyhidden'),
null,
\core\output\notification::NOTIFY_WARNING
);
}
if (!$capabilitymanager->can_view_discussions($USER, $forum)) {
if (!$capabilitymanager->can_view_discussions($USER)) {
redirect(
$urlfactory->get_course_url_from_forum($forum),
get_string('noviewdiscussionspermission', 'fourm'),
null,
\core\output\notification::NOTIFY_WARNING
);
}