*/
public static function getRollbackToken( $pageid, $title, $rev ) {
global $wgUser;
- if ( !$wgUser->isAllowed( 'rollback' ) ) {
+ if ( !MediaWikiServices::getInstance()->getPermissionManager()
+ ->userHasRight( $wgUser, 'rollback' ) ) {
return false;
}
if ( $resultPageSet === null && $this->fetchContent ) {
// For each page we will request, the user must have read rights for that page
- $user = $this->getUser();
$status = Status::newGood();
+ $user = $this->getUser();
+
/** @var Title $title */
foreach ( $pageSet->getGoodTitles() as $title ) {
- if ( !$title->userCan( 'read', $user ) ) {
+ if ( !$this->getPermissionManager()->userCan( 'read', $user, $title ) ) {
$status->fatal( ApiMessage::create(
[ 'apierror-cannotviewtitle', wfEscapeWikiText( $title->getPrefixedText() ) ],
'accessdenied'
}
if ( $params['user'] !== null || $params['excludeuser'] !== null ) {
// Paranoia: avoid brute force searches (T19342)
- if ( !$this->getUser()->isAllowed( 'deletedhistory' ) ) {
+ if ( !$this->getPermissionManager()->userHasRight( $this->getUser(), 'deletedhistory' ) ) {
$bitmask = RevisionRecord::DELETED_USER;
} elseif ( !$this->getUser()->isAllowedAny( 'suppressrevision', 'viewsuppressed' ) ) {
$bitmask = RevisionRecord::DELETED_USER | RevisionRecord::DELETED_RESTRICTED;
$this->addOption( 'LIMIT', $this->limit + 1 );
+ // T224017: `rev_timestamp` is never the correct index to use for this module, but
+ // MariaDB (10.1.37-39) sometimes insists on trying to use it anyway. Tell it not to.
+ $this->addOption( 'IGNORE INDEX', [ 'revision' => 'rev_timestamp' ] );
+
$count = 0;
$generated = [];
$hookData = [];