permission = $permission; if ( !count( $errors ) ) { $groups = []; foreach ( User::getGroupsWithPermission( $this->permission ) as $group ) { $groups[] = UserGroupMembership::getLink( $group, RequestContext::getMain(), 'wiki' ); } if ( $groups ) { $errors[] = [ 'badaccess-groups', $wgLang->commaList( $groups ), count( $groups ) ]; } else { $errors[] = [ 'badaccess-group0' ]; } } $this->errors = $errors; // Give the parent class something to work with parent::__construct( 'permissionserrors', Message::newFromSpecifier( $errors[0] ) ); } public function report() { global $wgOut; $wgOut->showPermissionsErrorPage( $this->errors, $this->permission ); $wgOut->output(); } }