jenkins-bot has submitted this change and it was merged.

Change subject: API: Don't check for 'globalunblock' right
......................................................................


API: Don't check for 'globalunblock' right

It was removed from the extension in d9a99c6bcc.

Change-Id: I55a14c43c3d85a7fc8ee86ba237602144d4e682f
---
M ApiGlobalBlock.php
1 file changed, 5 insertions(+), 8 deletions(-)

Approvals:
  Alex Monk: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/ApiGlobalBlock.php b/ApiGlobalBlock.php
index 2c4afcc..8b8d1e4 100644
--- a/ApiGlobalBlock.php
+++ b/ApiGlobalBlock.php
@@ -1,15 +1,16 @@
 <?php
 class ApiGlobalBlock extends ApiBase {
        public function execute() {
+               if ( !$this->getUser()->isAllowed( 'globalblock' ) ) {
+                       // Check permissions
+                       $this->dieUsageMsg( array( 'badaccess-groups' ) );
+               }
+
                $this->requireOnlyOneParameter( $this->extractRequestParams(), 
'expiry', 'unblock' );
                $result = $this->getResult();
                $block = GlobalBlocking::getGlobalBlockingBlock( 
$this->getParameter( 'target' ), true );
 
                if ( $this->getParameter( 'expiry' ) ) {
-                       if ( !$this->getUser()->isAllowed( 'globalblock' ) ) {
-                               $this->dieUsageMsg( array( 'badaccess-groups' ) 
);
-                       }
-
                        $options = array();
 
                        if ( $this->getParameter( 'anononly' ) ) {
@@ -48,10 +49,6 @@
                                $result->addValue( 'globalblock', 'expiry', 
$displayExpiry );
                        }
                } elseif ( $this->getParameter( 'unblock' ) ) {
-                       if ( !$this->getUser()->isAllowed( 'globalunblock' ) ) {
-                               $this->dieUsageMsg( array( 'badaccess-groups' ) 
);
-                       }
-
                        GlobalBlocking::getGlobalBlockingMaster()->delete(
                                'globalblocks',
                                array( 'gb_id' => $block->gb_id ),

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I55a14c43c3d85a7fc8ee86ba237602144d4e682f
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/GlobalBlocking
Gerrit-Branch: master
Gerrit-Owner: Legoktm <legoktm.wikipe...@gmail.com>
Gerrit-Reviewer: Alex Monk <kren...@gmail.com>
Gerrit-Reviewer: jenkins-bot

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to