MediaWiki master
MediaWiki\Rest\BasicAccess\StaticBasicAuthorizer Class Reference

An authorizer which returns a value from authorize() which is given in the constructor. More...

Inherits MediaWiki\Rest\BasicAccess\BasicAuthorizerInterface.

Collaboration diagram for MediaWiki\Rest\BasicAccess\StaticBasicAuthorizer:

Public Member Functions

 __construct ( $value=null)
 
 authorize (RequestInterface $request, Handler $handler)
 Determine whether a request should be permitted, given the handler's needsReadAccess() and needsWriteAccess().
 

Detailed Description

An authorizer which returns a value from authorize() which is given in the constructor.

Access: internal

Definition at line 13 of file StaticBasicAuthorizer.php.

Constructor & Destructor Documentation

◆ __construct()

MediaWiki\Rest\BasicAccess\StaticBasicAuthorizer::__construct ( $value = null)
See also
BasicAuthorizerInterface::authorize()
Parameters
string | null$valueThe value returned by authorize(). If the request is denied, this is the string error code. If the request is allowed, it is null.

Definition at line 23 of file StaticBasicAuthorizer.php.

Member Function Documentation

◆ authorize()

MediaWiki\Rest\BasicAccess\StaticBasicAuthorizer::authorize ( RequestInterface $request,
Handler $handler )

Determine whether a request should be permitted, given the handler's needsReadAccess() and needsWriteAccess().

If the request should be permitted, return null. If the request should be denied, return a string error identifier.

Parameters
RequestInterface$request
Handler$handler
Returns
string|null If the request is denied, the string error code. If the request is allowed, null.

Implements MediaWiki\Rest\BasicAccess\BasicAuthorizerInterface.

Definition at line 27 of file StaticBasicAuthorizer.php.


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