Fix for r65818: the proper permission is 'createpage', not 'create'. Skip checking...
authorBryan Tong Minh <btongminh@users.mediawiki.org>
Tue, 4 May 2010 14:48:56 +0000 (14:48 +0000)
committerBryan Tong Minh <btongminh@users.mediawiki.org>
Tue, 4 May 2010 14:48:56 +0000 (14:48 +0000)
includes/upload/UploadBase.php

index 3a6fd2e..d8a49a6 100644 (file)
@@ -83,7 +83,7 @@ abstract class UploadBase {
         * @return array
         */
        public static function getRequiredPermissions() {
-               return array( 'upload', 'create', 'edit' );
+               return array( 'upload', 'edit' );
        }
        /**
         * Returns true if the user can use this upload module or else a string
@@ -396,7 +396,11 @@ abstract class UploadBase {
                }
                $permErrors = $nt->getUserPermissionsErrors( 'edit', $user );
                $permErrorsUpload = $nt->getUserPermissionsErrors( 'upload', $user );
-               $permErrorsCreate = ( $nt->exists() ? array() : $nt->getUserPermissionsErrors( 'create', $user ) );
+               if ( $nt->exists() ) {
+                       $permErrorsCreate = $nt->getUserPermissionsErrors( 'createpage', $user );
+               } else {
+                       $permErrorsCreate = array();
+               }
                if( $permErrors || $permErrorsUpload || $permErrorsCreate ) {
                        $permErrors = array_merge( $permErrors, wfArrayDiff2( $permErrorsUpload, $permErrors ) );
                        $permErrors = array_merge( $permErrors, wfArrayDiff2( $permErrorsCreate, $permErrors ) );