From: jenkins-bot Date: Tue, 12 Mar 2013 14:52:31 +0000 (+0000) Subject: Merge "Use User::groupHasPermission" X-Git-Tag: 1.31.0-rc.0~20376 X-Git-Url: http://git.cyclocoop.org/%22%20.%20generer_url_ecrire%28%22articles_versions%22%2C%22id_article=%24id_article%22%29%20.%20%22?a=commitdiff_plain;h=6bc4c21ed1914abe31507fa132909e7f947e6075;hp=29cc91ef68341f2f2737740cba3a537fa83dc001;p=lhc%2Fweb%2Fwiklou.git Merge "Use User::groupHasPermission" --- diff --git a/includes/api/ApiMain.php b/includes/api/ApiMain.php index 4d17080f5a..80bca2f6ac 100644 --- a/includes/api/ApiMain.php +++ b/includes/api/ApiMain.php @@ -274,7 +274,7 @@ class ApiMain extends ApiBase { return; } - if ( !in_array( 'read', User::getGroupPermissions( array( '*' ) ), true ) ) { + if ( !User::groupHasPermission( '*', 'read' ) ) { // Private wiki, only private headers if ( $mode !== 'private' ) { wfDebug( __METHOD__ . ": ignoring request for $mode cache mode, private wiki\n" ); @@ -769,7 +769,7 @@ class ApiMain extends ApiBase { */ protected function checkExecutePermissions( $module ) { $user = $this->getUser(); - if ( $module->isReadMode() && !in_array( 'read', User::getGroupPermissions( array( '*' ) ), true ) && + if ( $module->isReadMode() && !User::groupHasPermission( '*', 'read' ) && !$user->isAllowed( 'read' ) ) { $this->dieUsageMsg( 'readrequired' );