$this->mRevIdFetched = $this->mRevision->getId();
$this->fetchResult = Status::newGood( $this->mRevision );
- if ( !$this->mRevision->userCan( Revision::DELETED_TEXT, $this->getContext()->getUser() ) ) {
+ if (
+ !$this->mRevision->userCan( RevisionRecord::DELETED_TEXT, $this->getContext()->getUser() )
+ ) {
wfDebug( __METHOD__ . " failed to retrieve content of revision " .
$this->mRevision->getId() . "\n" );
if ( Hooks::isRegistered( 'ArticleAfterFetchContentObject' ) ) {
$contentObject = $this->mRevision->getContent(
- Revision::FOR_THIS_USER,
+ RevisionRecord::FOR_THIS_USER,
$this->getContext()->getUser()
);
// For B/C only
$this->mContentObject = $this->mRevision->getContent(
- Revision::FOR_THIS_USER,
+ RevisionRecord::FOR_THIS_USER,
$this->getContext()->getUser()
);
if ( $outputPage->isPrintable() ) {
$parserOptions->setIsPrintable( true );
$poOptions['enableSectionEditLinks'] = false;
- } elseif ( $this->viewIsRenderAction
- || !$this->isCurrent() || !$this->getTitle()->quickUserCan( 'edit', $user )
+ } elseif ( $this->viewIsRenderAction || !$this->isCurrent() ||
+ !MediaWikiServices::getInstance()->getPermissionManager()
+ ->quickUserCan( 'edit', $user, $this->getTitle() )
) {
$poOptions['enableSectionEditLinks'] = false;
}
$title = $this->getTitle();
$rc = false;
- if ( !$title->quickUserCan( 'patrol', $user )
+ if ( !MediaWikiServices::getInstance()->getPermissionManager()
+ ->quickUserCan( 'patrol', $user, $title )
|| !( $wgUseRCPatrol || $wgUseNPPatrol
|| ( $wgUseFilePatrol && $title->inNamespace( NS_FILE ) ) )
) {
# Show error message
$oldid = $this->getOldID();
+ $pm = MediaWikiServices::getInstance()->getPermissionManager();
if ( !$oldid && $title->getNamespace() === NS_MEDIAWIKI && $title->hasSourceText() ) {
// use fake Content object for system message
$parserOptions = ParserOptions::newCanonical( 'canonical' );
} else {
if ( $oldid ) {
$text = wfMessage( 'missing-revision', $oldid )->plain();
- } elseif ( $title->quickUserCan( 'create', $this->getContext()->getUser() )
- && $title->quickUserCan( 'edit', $this->getContext()->getUser() )
+ } elseif ( $pm->quickUserCan( 'create', $this->getContext()->getUser(), $title ) &&
+ $pm->quickUserCan( 'edit', $this->getContext()->getUser(), $title )
) {
$message = $this->getContext()->getUser()->isLoggedIn() ? 'noarticletext' : 'noarticletextanon';
$text = wfMessage( $message )->plain();
* @return bool True if the view is allowed, false if not.
*/
public function showDeletedRevisionHeader() {
- if ( !$this->mRevision->isDeleted( Revision::DELETED_TEXT ) ) {
+ if ( !$this->mRevision->isDeleted( RevisionRecord::DELETED_TEXT ) ) {
// Not deleted
return true;
}
$outputPage = $this->getContext()->getOutput();
$user = $this->getContext()->getUser();
// If the user is not allowed to see it...
- if ( !$this->mRevision->userCan( Revision::DELETED_TEXT, $user ) ) {
+ if ( !$this->mRevision->userCan( RevisionRecord::DELETED_TEXT, $user ) ) {
$outputPage->wrapWikiMsg( "<div class='mw-warning plainlinks'>\n$1\n</div>\n",
'rev-deleted-text-permission' );
# Give explanation and add a link to view the revision...
$oldid = intval( $this->getOldID() );
$link = $this->getTitle()->getFullURL( "oldid={$oldid}&unhide=1" );
- $msg = $this->mRevision->isDeleted( Revision::DELETED_RESTRICTED ) ?
+ $msg = $this->mRevision->isDeleted( RevisionRecord::DELETED_RESTRICTED ) ?
'rev-suppressed-text-unhide' : 'rev-deleted-text-unhide';
$outputPage->wrapWikiMsg( "<div class='mw-warning plainlinks'>\n$1\n</div>\n",
[ $msg, $link ] );
return false;
// We are allowed to see...
} else {
- $msg = $this->mRevision->isDeleted( Revision::DELETED_RESTRICTED ) ?
+ $msg = $this->mRevision->isDeleted( RevisionRecord::DELETED_RESTRICTED ) ?
'rev-suppressed-text-view' : 'rev-deleted-text-view';
$outputPage->wrapWikiMsg( "<div class='mw-warning plainlinks'>\n$1\n</div>\n", $msg );
$outputPage->enableOOUI();
+ $fields = [];
+
$options = Xml::listDropDownOptions(
$ctx->msg( 'deletereason-dropdown' )->inContentLanguage()->text(),
[ 'other' => $ctx->msg( 'deletereasonotherlist' )->inContentLanguage()->text() ]
return $cacheable;
}
- /**#@-*/
+ /** #@- */
/**
* Lightweight method to get the parser output for a page, checking the parser cache
* Call to WikiPage function for backwards compatibility.
* @see WikiPage::getComment
*/
- public function getComment( $audience = Revision::FOR_PUBLIC, User $user = null ) {
+ public function getComment( $audience = RevisionRecord::FOR_PUBLIC, User $user = null ) {
return $this->mPage->getComment( $audience, $user );
}
* Call to WikiPage function for backwards compatibility.
* @see WikiPage::getCreator
*/
- public function getCreator( $audience = Revision::FOR_PUBLIC, User $user = null ) {
+ public function getCreator( $audience = RevisionRecord::FOR_PUBLIC, User $user = null ) {
return $this->mPage->getCreator( $audience, $user );
}
* Call to WikiPage function for backwards compatibility.
* @see WikiPage::getUser
*/
- public function getUser( $audience = Revision::FOR_PUBLIC, User $user = null ) {
+ public function getUser( $audience = RevisionRecord::FOR_PUBLIC, User $user = null ) {
return $this->mPage->getUser( $audience, $user );
}
* Call to WikiPage function for backwards compatibility.
* @see WikiPage::getUserText
*/
- public function getUserText( $audience = Revision::FOR_PUBLIC, User $user = null ) {
+ public function getUserText( $audience = RevisionRecord::FOR_PUBLIC, User $user = null ) {
return $this->mPage->getUserText( $audience, $user );
}