Permalink
Browse files

MDL-17965: Prevent forum move to forum you can't start discussions in

  • Loading branch information...
1 parent 8a76863 commit 576ba278bc7b03ea739f3eb62c3e967233b3ebe0 sam_marshall committed Jan 19, 2009
Showing with 5 additions and 1 deletion.
  1. +5 −1 mod/forum/discuss.php
View
@@ -70,6 +70,9 @@
error('Forum not visible', $return);
}
+ require_capability('mod/forum:startdiscussion',
+ get_context_instance(CONTEXT_MODULE,$cmto->id));
+
if (!forum_move_attachments($discussion, $forumto->id)) {
notify("Errors occurred while moving attachment directories - check your file permissions");
}
@@ -185,7 +188,8 @@
$section = -1;
$forummenu = array();
foreach ($modinfo->instances['forum'] as $forumcm) {
- if (!$forumcm->uservisible) {
+ if (!$forumcm->uservisible || !has_capability('mod/forum:startdiscussion',
+ get_context_instance(CONTEXT_MODULE,$forumcm->id))) {
continue;
}

0 comments on commit 576ba27

Please sign in to comment.