Merge "Exclude redirects from Special:Fewestrevisions"
[lhc/web/wiklou.git] / includes / Rest / BasicAccess / BasicAuthorizerInterface.php
1 <?php
2
3 namespace MediaWiki\Rest\BasicAccess;
4
5 use MediaWiki\Rest\Handler;
6 use MediaWiki\Rest\RequestInterface;
7
8 /**
9 * An interface used by Router to ensure that the client has "basic" access,
10 * i.e. the ability to read or write to the wiki.
11 *
12 * @internal
13 */
14 interface BasicAuthorizerInterface {
15 /**
16 * Determine whether a request should be permitted, given the handler's
17 * needsReadAccess() and needsWriteAccess().
18 *
19 * If the request should be permitted, return null. If the request should
20 * be denied, return a string error identifier.
21 *
22 * @param RequestInterface $request
23 * @param Handler $handler
24 * @return string|null If the request is denied, the string error code. If
25 * the request is allowed, null.
26 */
27 public function authorize( RequestInterface $request, Handler $handler );
28 }