3 namespace MediaWiki\Rest\BasicAccess
;
5 use MediaWiki\Rest\Handler
;
6 use MediaWiki\Rest\RequestInterface
;
9 * An authorizer which returns a value from authorize() which is given in the constructor.
13 class StaticBasicAuthorizer
implements BasicAuthorizerInterface
{
17 * @see BasicAuthorizerInterface::authorize()
19 * @param string|null $value The value returned by authorize(). If the
20 * request is denied, this is the string error code. If the request is
21 * allowed, it is null.
23 public function __construct( $value = null ) {
24 $this->value
= $value;
27 public function authorize( RequestInterface
$request, Handler
$handler ) {