Bug: T294397 Depends-On: Ib34228a18917e404517d45e539bd786419d9c401 Change-Id: Ifad2edc782b36d21c8c67fecde7f011dce02c11b
33 lines
684 B
PHP
33 lines
684 B
PHP
<?php
|
|
|
|
namespace MediaWiki\Rest\BasicAccess;
|
|
|
|
use MediaWiki\Permissions\Authority;
|
|
use MediaWiki\Rest\Handler;
|
|
use MediaWiki\Rest\RequestInterface;
|
|
|
|
/**
|
|
* The concrete implementation of basic read/write restrictions in MediaWiki
|
|
*
|
|
* @internal
|
|
*/
|
|
class MWBasicRequestAuthorizer extends BasicRequestAuthorizer {
|
|
private Authority $authority;
|
|
|
|
public function __construct(
|
|
RequestInterface $request,
|
|
Handler $handler,
|
|
Authority $authority
|
|
) {
|
|
parent::__construct( $request, $handler );
|
|
$this->authority = $authority;
|
|
}
|
|
|
|
protected function isReadAllowed() {
|
|
return $this->authority->isAllowed( 'read' );
|
|
}
|
|
|
|
protected function isWriteAllowed() {
|
|
return true;
|
|
}
|
|
}
|