Dan-nl has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/102814


Change subject: correcting gwtoolset permission check
......................................................................

correcting gwtoolset permission check

Bug: 58602
Change-Id: Ibd1ab2c9fe4f72d4b9ca7f1515a49bd73a15babe
---
M GWToolset.i18n.php
M includes/Config.php
M includes/Helpers/WikiChecks.php
3 files changed, 5 insertions(+), 17 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/GWToolset 
refs/changes/14/102814/1

diff --git a/GWToolset.i18n.php b/GWToolset.i18n.php
index c2c8d9d..7f93f3a 100644
--- a/GWToolset.i18n.php
+++ b/GWToolset.i18n.php
@@ -269,7 +269,6 @@
 
 These are set lower than the wiki\'s <code>$wgMaxUploadSize</code>, which is 
set at "$3". Please adjust the <code>php.ini</code> settings as appropriate.',
        'gwtoolset-mediawiki-version-invalid' => 'This extension requires 
MediaWiki version $1<br />This MediaWiki version is $2.',
-       'gwtoolset-no-upload-by-url' => 'You are not part of a group that has 
the right to upload by URL.',
        'gwtoolset-permission-not-given' => 'Make sure that you are logged in 
or contact an administrator in order to be granted permission to view this page 
($1).',
        'gwtoolset-user-blocked' => 'Your user account is currently blocked. 
Please contact an administrator in order to correct the blocking issue.',
        'gwtoolset-required-group' => 'You are not a member of the, $1, group.',
diff --git a/includes/Config.php b/includes/Config.php
index 7b7d47a..ef1dd08 100644
--- a/includes/Config.php
+++ b/includes/Config.php
@@ -206,7 +206,7 @@
         * @var {string}
         * user right required, e.g. "block" or "delete"
         */
-       public static $special_page_restriction = 'upload_by_url';
+       public static $special_page_restriction = 'gwtoolset';
 
        /**
         * @see SpecialPage __constructor
@@ -247,9 +247,10 @@
         * @see GWToolset\Helpers\WikiChecks\checkUserPermissions
         */
        public static $user_permissions = array(
+               'edit',
+               'gwtoolset',
                'upload',
-               'upload_by_url',
-               'edit'
+               'upload_by_url'
        );
 
 }
diff --git a/includes/Helpers/WikiChecks.php b/includes/Helpers/WikiChecks.php
index 3cb4141..2b9da0c 100644
--- a/includes/Helpers/WikiChecks.php
+++ b/includes/Helpers/WikiChecks.php
@@ -40,14 +40,7 @@
         * @return {Status}
         */
        public static function canUserViewPage( SpecialPage $SpecialPage ) {
-               try {
-                       $SpecialPage->checkPermissions();
-               } catch ( PermissionsError $e ) {
-                       return Status::newFatal(
-                               'gwtoolset-permission-not-given',
-                               wfMessage( 'gwtoolset-no-upload-by-url' 
)->escaped()
-                       );
-               }
+               $SpecialPage->checkPermissions();
 
                return Status::newGood();
        }
@@ -292,11 +285,6 @@
                }
 
                $Status = self::canUserViewPage( $SpecialPage );
-               if ( !$Status->ok ) {
-                       return $Status;
-               }
-
-               $Status = self::checkUserWikiGroups( $SpecialPage );
                if ( !$Status->ok ) {
                        return $Status;
                }

-- 
To view, visit https://gerrit.wikimedia.org/r/102814
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ibd1ab2c9fe4f72d4b9ca7f1515a49bd73a15babe
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/GWToolset
Gerrit-Branch: master
Gerrit-Owner: Dan-nl <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to