MediaWiki
REL1_40
MWBasicRequestAuthorizer.php
Go to the documentation of this file.
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
14
class
MWBasicRequestAuthorizer
extends
BasicRequestAuthorizer
{
16
private
$authority;
17
18
public
function
__construct
(
19
RequestInterface
$request
,
20
Handler
$handler
,
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
}
MediaWiki\Rest\BasicAccess\BasicRequestAuthorizer
A request authorizer which checks needsReadAccess() and needsWriteAccess() in the handler and calls i...
Definition
BasicRequestAuthorizer.php:15
MediaWiki\Rest\BasicAccess\BasicRequestAuthorizer\$handler
$handler
Definition
BasicRequestAuthorizer.php:17
MediaWiki\Rest\BasicAccess\BasicRequestAuthorizer\$request
$request
Definition
BasicRequestAuthorizer.php:16
MediaWiki\Rest\BasicAccess\MWBasicRequestAuthorizer
The concrete implementation of basic read/write restrictions in MediaWiki.
Definition
MWBasicRequestAuthorizer.php:14
MediaWiki\Rest\BasicAccess\MWBasicRequestAuthorizer\__construct
__construct(RequestInterface $request, Handler $handler, Authority $authority)
Definition
MWBasicRequestAuthorizer.php:18
MediaWiki\Rest\BasicAccess\MWBasicRequestAuthorizer\isWriteAllowed
isWriteAllowed()
Check if the current user is allowed to write to the wiki.
Definition
MWBasicRequestAuthorizer.php:31
MediaWiki\Rest\BasicAccess\MWBasicRequestAuthorizer\isReadAllowed
isReadAllowed()
Check if the current user is allowed to read from the wiki.
Definition
MWBasicRequestAuthorizer.php:27
MediaWiki\Rest\Handler
Base class for REST route handlers.
Definition
Handler.php:20
MediaWiki\Permissions\Authority
This interface represents the authority associated the current execution context, such as a web reque...
Definition
Authority.php:37
MediaWiki\Rest\RequestInterface
A request interface similar to PSR-7's ServerRequestInterface.
Definition
RequestInterface.php:39
MediaWiki\Rest\BasicAccess
Definition
BasicAuthorizerBase.php:3
MediaWiki\Rest\Handler
Copyright (C) 2011-2020 Wikimedia Foundation and others.
Definition
AbstractContributionHandler.php:3
includes
Rest
BasicAccess
MWBasicRequestAuthorizer.php
Generated on Thu Jun 27 2024 14:03:54 for MediaWiki by
1.10.0