"MDL-23917, fixed the capability check, comment api"
authorDongsheng Cai <unoter@gmail.com>
Wed, 25 Aug 2010 08:20:46 +0000 (08:20 +0000)
committerDongsheng Cai <unoter@gmail.com>
Wed, 25 Aug 2010 08:20:46 +0000 (08:20 +0000)
comment/lib.php

index dcf3c91..f8639e2 100644 (file)
@@ -254,11 +254,11 @@ EOD;
         if (!empty($this->plugintype)) {
             $permissions = plugin_callback($this->plugintype, $this->pluginname, FEATURE_COMMENT, 'permissions', array($this->args), array('post'=>true, 'view'=>true));
             if ($this->ignore_permission) {
-                $this->postcap = $this->postcap && $permissions['post'];
-                $this->viewcap = $this->viewcap && $permissions['view'];
-            } else {
                 $this->postcap = $permissions['post'];
                 $this->viewcap = $permissions['view'];
+            } else {
+                $this->postcap = $this->postcap && $permissions['post'];
+                $this->viewcap = $this->viewcap && $permissions['view'];
             }
         }
     }