Page MenuHomeWickedGov Phorge

StaticBasicAuthorizer.php
No OneTemporary

Size
771 B
Referenced Files
None
Subscribers
None

StaticBasicAuthorizer.php

<?php
namespace MediaWiki\Rest\BasicAccess;
use MediaWiki\Rest\Handler;
use MediaWiki\Rest\RequestInterface;
/**
* An authorizer which returns a value from authorize() which is given in the constructor.
*
* @internal
*/
class StaticBasicAuthorizer implements BasicAuthorizerInterface {
/** @var string|null */
private $value;
/**
* @see BasicAuthorizerInterface::authorize()
*
* @param string|null $value The value returned by authorize(). If the
* request is denied, this is the string error code. If the request is
* allowed, it is null.
*/
public function __construct( $value = null ) {
$this->value = $value;
}
/** @inheritDoc */
public function authorize( RequestInterface $request, Handler $handler ) {
return $this->value;
}
}

File Metadata

Mime Type
text/x-php
Expires
Tue, Aug 18, 18:33 (3 w, 1 d ago)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
78/d5/124ac68559a3f218c8f05506d359
Default Alt Text
StaticBasicAuthorizer.php (771 B)

Event Timeline