]> git.mjollnir.org Git - moodle.git/commitdiff
merged fix for MDL-7066, users will replypost set to prohit can not edit own post
authortoyomoyo <toyomoyo>
Wed, 18 Oct 2006 07:50:22 +0000 (07:50 +0000)
committertoyomoyo <toyomoyo>
Wed, 18 Oct 2006 07:50:22 +0000 (07:50 +0000)
mod/forum/post.php

index 0b2705ba672b6c69d18f0780668b48f5069309e8..a6dfd055639a29be0464d2c32485a32f1bac7d83 100644 (file)
                 $realpost = new object;
                 $realpost->userid = -1;
             }
-
-            if ( !(($realpost->userid == $USER->id && has_capability('mod/forum:replypost', $modcontext)) ||
-                        has_capability('mod/forum:editanypost', $modcontext)) ) {
+            
+            
+            // if user has edit any post capability
+            // or has either startnewdiscussion or reply capability and is editting own post
+            // then he can proceed
+            // MDL-7066
+            if ( !(($realpost->userid == $USER->id && (has_capability('mod/forum:replypost', $modcontext) 
+                                || has_capability('mod/forum:startdiscussion', $modcontext))) ||
+                                has_capability('mod/forum:editanypost', $modcontext)) ) {
                 error("You can not update this post");
             }