Do not allow a user to delete a page they can't edit
[lhc/web/wiklou.git] / includes / api / ApiFileRevert.php
index 1941fbd..58e4ff9 100644 (file)
@@ -71,7 +71,7 @@ class ApiFileRevert extends ApiBase {
        /**
         * Checks that the user has permissions to perform this revert.
         * Dies with usage message on inadequate permissions.
-        * @param $user User The user to check.
+        * @param User $user The user to check.
         */
        protected function checkPermissions( $user ) {
                $title = $this->file->getTitle();
@@ -148,41 +148,12 @@ class ApiFileRevert extends ApiBase {
                );
        }
 
-       public function getResultProperties() {
-               return array(
-                       '' => array(
-                               'result' => array(
-                                       ApiBase::PROP_TYPE => array(
-                                               'Success',
-                                               'Failure'
-                                       )
-                               ),
-                               'errors' => array(
-                                       ApiBase::PROP_TYPE => 'string',
-                                       ApiBase::PROP_NULLABLE => true
-                               )
-                       )
-               );
-       }
-
        public function getDescription() {
                return array(
                        'Revert a file to an old version.'
                );
        }
 
-       public function getPossibleErrors() {
-               return array_merge( parent::getPossibleErrors(),
-                       array(
-                               array( 'mustbeloggedin', 'upload' ),
-                               array( 'badaccess-groups' ),
-                               array( 'invalidtitle', 'title' ),
-                               array( 'notanarticle' ),
-                               array( 'filerevert-badversion' ),
-                       )
-               );
-       }
-
        public function needsToken() {
                return true;
        }