Debian Codegraph @

includes/Rest/BasicAccess/MWBasicRequestAuthorizer.php

raw symbols SCIP
1 <?php
2
3 namespace MediaWiki\Rest\BasicAccess;
4
5 use MediaWiki\Permissions\Authority;
6 use MediaWiki\Rest\Handler;
7 use MediaWiki\Rest\RequestInterface;
8
9 /**
10 * The concrete implementation of basic read/write restrictions in MediaWiki
11 *
12 * @internal
13 */
14 class MWBasicRequestAuthorizer extends BasicRequestAuthorizer {
15 private Authority $authority;
16
17 public function __construct(
18 RequestInterface $request,
19 Handler $handler,
20 Authority $authority
21 ) {
22 parent::__construct( $request, $handler );
23 $this->authority = $authority;
24 }
25
26 protected function isReadAllowed() {
27 return $this->authority->isAllowed( 'read' );
28 }
29
30 protected function isWriteAllowed() {
31 return true;
32 }
33 }