MediaWiki master
MediaWiki\Rest\BasicAccess\BasicRequestAuthorizer Class Reference

A request authorizer which checks needsReadAccess() and needsWriteAccess() in the handler and calls isReadAllowed() and/or isWriteAllowed() in the subclass accordingly. More...

Inherited by MediaWiki\Rest\BasicAccess\MWBasicRequestAuthorizer.

Public Member Functions

 __construct (RequestInterface $request, Handler $handler)
 
 authorize ()
 

Protected Member Functions

 isReadAllowed ()
 Check if the current user is allowed to read from the wiki.
 
 isWriteAllowed ()
 Check if the current user is allowed to write to the wiki.
 

Protected Attributes

 $handler
 
 $request
 

Detailed Description

A request authorizer which checks needsReadAccess() and needsWriteAccess() in the handler and calls isReadAllowed() and/or isWriteAllowed() in the subclass accordingly.

Access: internal

Definition at line 15 of file BasicRequestAuthorizer.php.

Constructor & Destructor Documentation

◆ __construct()

MediaWiki\Rest\BasicAccess\BasicRequestAuthorizer::__construct ( RequestInterface  $request,
Handler  $handler 
)
Parameters
RequestInterface$request
Handler$handler

Definition at line 23 of file BasicRequestAuthorizer.php.

References MediaWiki\Rest\BasicAccess\BasicRequestAuthorizer\$handler, and MediaWiki\Rest\BasicAccess\BasicRequestAuthorizer\$request.

Member Function Documentation

◆ authorize()

MediaWiki\Rest\BasicAccess\BasicRequestAuthorizer::authorize ( )
See also
BasicAuthorizerInterface::authorize()
Returns
string|null If the request is denied, the string error code. If the request is allowed, null.

Definition at line 33 of file BasicRequestAuthorizer.php.

◆ isReadAllowed()

MediaWiki\Rest\BasicAccess\BasicRequestAuthorizer::isReadAllowed ( )
abstractprotected

Check if the current user is allowed to read from the wiki.

Returns
bool

Reimplemented in MediaWiki\Rest\BasicAccess\MWBasicRequestAuthorizer.

◆ isWriteAllowed()

MediaWiki\Rest\BasicAccess\BasicRequestAuthorizer::isWriteAllowed ( )
abstractprotected

Check if the current user is allowed to write to the wiki.

Returns
bool

Reimplemented in MediaWiki\Rest\BasicAccess\MWBasicRequestAuthorizer.

Member Data Documentation

◆ $handler

MediaWiki\Rest\BasicAccess\BasicRequestAuthorizer::$handler
protected

◆ $request

MediaWiki\Rest\BasicAccess\BasicRequestAuthorizer::$request
protected

The documentation for this class was generated from the following file: