use InvalidArgumentException;
use LogicException;
use MediaWiki\Linker\LinkTarget;
+use MediaWiki\MediaWikiServices;
use MediaWiki\User\UserIdentity;
use MWException;
use Title;
protected $mWiki = false;
/** @var int|null */
protected $mId;
- /** @var int|null */
+ /** @var int */
protected $mPageId;
/** @var UserIdentity|null */
protected $mUser;
} else {
$text = $title->getPrefixedText();
wfDebug( "Checking for $permissionlist on $text due to $field match on $bitfield\n" );
+
+ $permissionManager = MediaWikiServices::getInstance()->getPermissionManager();
+
foreach ( $permissions as $perm ) {
- if ( $title->userCan( $perm, $user ) ) {
+ if ( $permissionManager->userCan( $perm, $user, $title ) ) {
return true;
}
}
// null if mSlots is not empty.
// NOTE: getId() and getPageId() may return null before a revision is saved, so don't
- //check them.
+ // check them.
return $this->getTimestamp() !== null
&& $this->getComment( self::RAW ) !== null