dépôts
/
lhc
/
web
/
wiklou.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge "services: Do not use deprecated ReflectionType::__toString() in tests"
[lhc/web/wiklou.git]
/
includes
/
api
/
ApiQueryInfo.php
diff --git
a/includes/api/ApiQueryInfo.php
b/includes/api/ApiQueryInfo.php
index
90f1340
..
98474c7
100644
(file)
--- a/
includes/api/ApiQueryInfo.php
+++ b/
includes/api/ApiQueryInfo.php
@@
-118,6
+118,7
@@
class ApiQueryInfo extends ApiQueryBase {
return $this->tokenFunctions;
}
return $this->tokenFunctions;
}
+ /** @var string[] */
protected static $cachedTokens = [];
/**
protected static $cachedTokens = [];
/**
@@
-135,7
+136,8
@@
class ApiQueryInfo extends ApiQueryBase {
// but that's too expensive for this purpose
// and would break caching
global $wgUser;
// but that's too expensive for this purpose
// and would break caching
global $wgUser;
- if ( !$wgUser->isAllowed( 'edit' ) ) {
+ if ( !MediaWikiServices::getInstance()->getPermissionManager()
+ ->userHasRight( $wgUser, 'edit' ) ) {
return false;
}
return false;
}
@@
-152,7
+154,8
@@
class ApiQueryInfo extends ApiQueryBase {
*/
public static function getDeleteToken( $pageid, $title ) {
global $wgUser;
*/
public static function getDeleteToken( $pageid, $title ) {
global $wgUser;
- if ( !$wgUser->isAllowed( 'delete' ) ) {
+ if ( !MediaWikiServices::getInstance()->getPermissionManager()
+ ->userHasRight( $wgUser, 'delete' ) ) {
return false;
}
return false;
}
@@
-169,7
+172,8
@@
class ApiQueryInfo extends ApiQueryBase {
*/
public static function getProtectToken( $pageid, $title ) {
global $wgUser;
*/
public static function getProtectToken( $pageid, $title ) {
global $wgUser;
- if ( !$wgUser->isAllowed( 'protect' ) ) {
+ if ( !MediaWikiServices::getInstance()->getPermissionManager()
+ ->userHasRight( $wgUser, 'protect' ) ) {
return false;
}
return false;
}
@@
-186,7
+190,8
@@
class ApiQueryInfo extends ApiQueryBase {
*/
public static function getMoveToken( $pageid, $title ) {
global $wgUser;
*/
public static function getMoveToken( $pageid, $title ) {
global $wgUser;
- if ( !$wgUser->isAllowed( 'move' ) ) {
+ if ( !MediaWikiServices::getInstance()->getPermissionManager()
+ ->userHasRight( $wgUser, 'move' ) ) {
return false;
}
return false;
}
@@
-203,7
+208,8
@@
class ApiQueryInfo extends ApiQueryBase {
*/
public static function getBlockToken( $pageid, $title ) {
global $wgUser;
*/
public static function getBlockToken( $pageid, $title ) {
global $wgUser;
- if ( !$wgUser->isAllowed( 'block' ) ) {
+ if ( !MediaWikiServices::getInstance()->getPermissionManager()
+ ->userHasRight( $wgUser, 'block' ) ) {
return false;
}
return false;
}
@@
-245,7
+251,9
@@
class ApiQueryInfo extends ApiQueryBase {
*/
public static function getImportToken( $pageid, $title ) {
global $wgUser;
*/
public static function getImportToken( $pageid, $title ) {
global $wgUser;
- if ( !$wgUser->isAllowedAny( 'import', 'importupload' ) ) {
+ if ( !MediaWikiServices::getInstance()
+ ->getPermissionManager()
+ ->userHasAnyRight( $wgUser, 'import', 'importupload' ) ) {
return false;
}
return false;
}
@@
-808,7
+816,7
@@
class ApiQueryInfo extends ApiQueryBase {
$user = $this->getUser();
if ( $user->isAnon() || count( $this->everything ) == 0
$user = $this->getUser();
if ( $user->isAnon() || count( $this->everything ) == 0
- || !$
user->isAllowed(
'viewmywatchlist' )
+ || !$
this->getPermissionManager()->userHasRight( $user,
'viewmywatchlist' )
) {
return;
}
) {
return;
}
@@
-843,7
+851,7
@@
class ApiQueryInfo extends ApiQueryBase {
}
$user = $this->getUser();
}
$user = $this->getUser();
- $canUnwatchedpages = $
user->isAllowed(
'unwatchedpages' );
+ $canUnwatchedpages = $
this->getPermissionManager()->userHasRight( $user,
'unwatchedpages' );
$unwatchedPageThreshold = $this->getConfig()->get( 'UnwatchedPageThreshold' );
if ( !$canUnwatchedpages && !is_int( $unwatchedPageThreshold ) ) {
return;
$unwatchedPageThreshold = $this->getConfig()->get( 'UnwatchedPageThreshold' );
if ( !$canUnwatchedpages && !is_int( $unwatchedPageThreshold ) ) {
return;
@@
-873,7
+881,7
@@
class ApiQueryInfo extends ApiQueryBase {
$user = $this->getUser();
$db = $this->getDB();
$user = $this->getUser();
$db = $this->getDB();
- $canUnwatchedpages = $
user->isAllowed(
'unwatchedpages' );
+ $canUnwatchedpages = $
this->getPermissionManager()->userHasRight( $user,
'unwatchedpages' );
$unwatchedPageThreshold = $this->getConfig()->get( 'UnwatchedPageThreshold' );
if ( !$canUnwatchedpages && !is_int( $unwatchedPageThreshold ) ) {
return;
$unwatchedPageThreshold = $this->getConfig()->get( 'UnwatchedPageThreshold' );
if ( !$canUnwatchedpages && !is_int( $unwatchedPageThreshold ) ) {
return;