MediaWiki
master
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
{
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
}
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:17
MediaWiki\Rest\BasicAccess\MWBasicRequestAuthorizer\isWriteAllowed
isWriteAllowed()
Check if the current user is allowed to write to the wiki.
Definition
MWBasicRequestAuthorizer.php:30
MediaWiki\Rest\BasicAccess\MWBasicRequestAuthorizer\isReadAllowed
isReadAllowed()
Check if the current user is allowed to read from the wiki.
Definition
MWBasicRequestAuthorizer.php:26
MediaWiki\Rest\Handler
Base class for REST route handlers.
Definition
Handler.php:25
MediaWiki\Permissions\Authority
This interface represents the authority associated with the current execution context,...
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
ActionModuleBasedHandler.php:3
includes
Rest
BasicAccess
MWBasicRequestAuthorizer.php
Generated on Sat Sep 7 2024 20:24:26 for MediaWiki by
1.10.0