MediaWiki  1.34.0
MediaWiki\Rest\BasicAccess\StaticBasicAuthorizer Class Reference

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

Inheritance diagram for MediaWiki\Rest\BasicAccess\StaticBasicAuthorizer:
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(). More...
 

Private Attributes

 $value
 

Detailed Description

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

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.

References MediaWiki\Rest\BasicAccess\StaticBasicAuthorizer\$value, and value.

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.

References MediaWiki\Rest\BasicAccess\StaticBasicAuthorizer\$value.

Member Data Documentation

◆ $value

MediaWiki\Rest\BasicAccess\StaticBasicAuthorizer::$value
private

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