MediaWiki REL1_40
MWBasicRequestAuthorizer.php
Go to the documentation of this file.
1<?php
2
4
8
16 private $authority;
17
18 public function __construct(
21 Authority $authority
22 ) {
23 parent::__construct( $request, $handler );
24 $this->authority = $authority;
25 }
26
27 protected function isReadAllowed() {
28 return $this->authority->isAllowed( 'read' );
29 }
30
31 protected function isWriteAllowed() {
32 return $this->authority->isAllowed( 'writeapi' );
33 }
34}
A request authorizer which checks needsReadAccess() and needsWriteAccess() in the handler and calls i...
The concrete implementation of basic read/write restrictions in MediaWiki.
__construct(RequestInterface $request, Handler $handler, Authority $authority)
isWriteAllowed()
Check if the current user is allowed to write to the wiki.
isReadAllowed()
Check if the current user is allowed to read from the wiki.
Base class for REST route handlers.
Definition Handler.php:20
This interface represents the authority associated the current execution context, such as a web reque...
Definition Authority.php:37
A request interface similar to PSR-7's ServerRequestInterface.
Copyright (C) 2011-2020 Wikimedia Foundation and others.