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...

Inheritance diagram for MediaWiki\Rest\BasicAccess\BasicRequestAuthorizer:

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. More...
 
 isWriteAllowed ()
 Check if the current user is allowed to write to the wiki. More...
 

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.

Definition at line 15 of file BasicRequestAuthorizer.php.

Constructor & Destructor Documentation

◆ __construct()

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

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.

References MediaWiki\Rest\BasicAccess\BasicRequestAuthorizer\isReadAllowed(), and MediaWiki\Rest\BasicAccess\BasicRequestAuthorizer\isWriteAllowed().

◆ isReadAllowed()

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

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

Returns
bool

Referenced by MediaWiki\Rest\BasicAccess\BasicRequestAuthorizer\authorize().

◆ isWriteAllowed()

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

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

Returns
bool

Referenced by MediaWiki\Rest\BasicAccess\BasicRequestAuthorizer\authorize().

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: