Merge "New hook ApiCheckCanExecute."
[lhc/web/wiklou.git] / includes / api / ApiMain.php
index 2a94a65..35febd9 100644 (file)
@@ -761,6 +761,12 @@ class ApiMain extends ApiBase {
                                $this->dieReadOnly();
                        }
                }
+
+               // Allow extensions to stop execution for arbitrary reasons.
+               $message = false;
+               if( !wfRunHooks( 'ApiCheckCanExecute', array( $module, $user, &$message ) ) ) {
+                       $this->dieUsageMsg( $message );
+               }
        }
 
        /**