Robert Vogel has submitted this change and it was merged.

Change subject: UniversalExport: Fixed permission error for special pages
......................................................................


UniversalExport: Fixed permission error for special pages

* Used isAllowed instead of userCan if requested title is a special page
* Added descriptiom

Change-Id: I0723f3ecc94dafd8a31afbb5d5d73efb892edb75
---
M UniversalExport/includes/specials/SpecialUniversalExport.class.php
1 file changed, 6 insertions(+), 1 deletion(-)

Approvals:
  Robert Vogel: Verified; Looks good to me, approved
  Smuggli: Checked; Looks good to me, but someone else must approve



diff --git a/UniversalExport/includes/specials/SpecialUniversalExport.class.php 
b/UniversalExport/includes/specials/SpecialUniversalExport.class.php
index e36b337..e34d977 100644
--- a/UniversalExport/includes/specials/SpecialUniversalExport.class.php
+++ b/UniversalExport/includes/specials/SpecialUniversalExport.class.php
@@ -132,7 +132,12 @@
 
                        BsUniversalExportHelper::getParamsFromQueryString( 
$this->aParams );
 
-                       if ( $this->oRequestedTitle->userCan( 
'universalexport-export' ) === false ) {
+                       //Title::userCan always returns false on special pages 
(exept for createaccount action)
+                       if( $this->oRequestedTitle->getNamespace() === 
NS_SPECIAL ) {
+                               if( 
$this->getUser()->isAllowed('universalexport-export') !== true ) {
+                                       throw new Exception( 
'bs-universalexport-error-permission');
+                               }
+                       } elseif( $this->oRequestedTitle->userCan( 
'universalexport-export' ) === false ) {
                                throw new Exception( 
'bs-universalexport-error-permission');
                        }
 

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I0723f3ecc94dafd8a31afbb5d5d73efb892edb75
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/extensions/BlueSpiceExtensions
Gerrit-Branch: master
Gerrit-Owner: Pwirth <wi...@hallowelt.biz>
Gerrit-Reviewer: Mglaser <gla...@hallowelt.biz>
Gerrit-Reviewer: Pigpen <reym...@hallowelt.biz>
Gerrit-Reviewer: Robert Vogel <vo...@hallowelt.biz>
Gerrit-Reviewer: Smuggli <mug...@hallowelt.biz>
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