diff --git a/mod/forum/discuss.php b/mod/forum/discuss.php index 9a3260a4dc3..64347222d2d 100644 --- a/mod/forum/discuss.php +++ b/mod/forum/discuss.php @@ -146,6 +146,8 @@ $groupmode = groupmode($course, $cm); } + + if ($groupmode and !isteacheredit($course->id)) { // Groups must be kept separate //change this to ismember $mygroupid = mygroupid($course->id);//only useful if 0, otherwise it's an array now @@ -167,6 +169,14 @@ } } + //if forum is hidden then only teacher and admin can see it + if ($forum->visible == 0 and !isadmin() and !isteacher($course->id)) { + print_heading("Sorry, you don't have permission to see this discussion"); + print_footer($course); + die; + } + + /// Print the controls across the top