51 throw new \InvalidArgumentException( __METHOD__ .
52 ': $permission and $errors cannot both be empty' );
59 foreach ( MediaWikiServices::getInstance()
60 ->getGroupPermissionsLookup()
62 ->getGroupsWithPermission( $this->permission ) as $group
68 $errors[] = [
'badaccess-groups',
$wgLang->commaList( $groups ), count( $groups ) ];
70 $errors[] = [
'badaccess-group0' ];
80 public function report( $action = self::SEND_OUTPUT ) {
83 $wgOut->showPermissionsErrorPage( $this->errors, $this->permission );
84 if ( $action === self::SEND_OUTPUT ) {
if(!defined( 'MW_NO_SESSION') &&! $wgCommandLineMode) $wgOut
if(!defined( 'MW_NO_SESSION') &&! $wgCommandLineMode) $wgLang
An error page which can definitely be safely rendered using the OutputPage.
static newFromSpecifier( $value)
Transform a MessageSpecifier or a primitive value used interchangeably with specifiers (a message key...
Show an error when a user tries to do something they do not have the necessary permissions for.
report( $action=self::SEND_OUTPUT)
__construct( $permission, $errors=[])
static getMain()
Get the RequestContext object associated with the main request.
static getLink( $ugm, IContextSource $context, $format, $userName=null)
Gets a link for a user group, possibly including the expiry date if relevant.