}
// Check user authorization for this title
- // UserCanRead Checks Whitelist too
- if ( !$title->userCanRead() ) {
+ // Checks Whitelist too
+ if ( !$title->userCan( 'read' ) ) {
wfForbidden( 'img-auth-accessdenied', 'img-auth-noread', $name );
return;
}
protected function showCustomIntro() {
if ( $this->editintro ) {
$title = Title::newFromText( $this->editintro );
- if ( $title instanceof Title && $title->exists() && $title->userCanRead() ) {
+ if ( $title instanceof Title && $title->exists() && $title->userCan( 'read' ) ) {
global $wgOut;
// Added using template syntax, to take <noinclude>'s into account.
$wgOut->addWikiTextTitleTidy( '{{:' . $title->getFullText() . '}}', $this->mTitle );
# Don't return to a page the user can't read otherwise
# we'll end up in a pointless loop
- if ( $displayReturnto && $displayReturnto->userCanRead() ) {
+ if ( $displayReturnto && $displayReturnto->userCan( 'read' ) ) {
$this->returnToMain( null, $displayReturnto );
}
} else {
$titles = $pageSet->getGoodTitles();
if ( count( $titles ) ) {
foreach ( $titles as $title ) {
- if ( $title->userCanRead() ) {
+ if ( $title->userCan( 'read' ) ) {
$exportTitles[] = $title;
}
}
$pageInfo['fullurl'] = wfExpandUrl( $title->getFullURL(), PROTO_CURRENT );
$pageInfo['editurl'] = wfExpandUrl( $title->getFullURL( 'action=edit' ), PROTO_CURRENT );
}
- if ( $this->fld_readable && $title->userCanRead() ) {
+ if ( $this->fld_readable && $title->userCan( 'read' ) ) {
$pageInfo['readable'] = '';
}
if ( isset( $prop['content'] ) || !is_null( $this->difftotext ) ) {
// For each page we will request, the user must have read rights for that page
foreach ( $pageSet->getGoodTitles() as $title ) {
- if ( !$title->userCanRead() ) {
+ if ( !$title->userCan( 'read' ) ) {
$this->dieUsage(
'The current user is not allowed to read ' . $title->getPrefixedText(),
'accessdenied' );
if( is_null( $title ) ) {
continue; #TODO: perhaps output an <error> tag or something.
}
- if( !$title->userCanRead() ) {
+ if( !$title->userCan( 'read' ) ) {
continue; #TODO: perhaps output an <error> tag or something.
}
// Check permissions if there are read restrictions
if ( !in_array( 'read', User::getGroupPermissions( array( '*' ) ), true ) ) {
- if ( !$img->getTitle()->userCanRead() ) {
+ if ( !$img->getTitle()->userCan( 'read' ) ) {
wfThumbError( 403, 'Access denied. You do not have permission to access ' .
'the source file.' );
wfProfileOut( __METHOD__ );