MediaWiki REL1_34
MWBasicAuthorizer.php
Go to the documentation of this file.
1<?php
2
4
9
17 private $user;
18
21
23 $this->user = $user;
24 $this->permissionManager = $permissionManager;
25 }
26
27 protected function createRequestAuthorizer( RequestInterface $request,
28 Handler $handler
30 return new MWBasicRequestAuthorizer( $request, $handler, $this->user,
31 $this->permissionManager );
32 }
33}
A service class for checking permissions To obtain an instance, use MediaWikiServices::getInstance()-...
An implementation of BasicAuthorizerInterface which creates a request-local object (a request authori...
A request authorizer which checks needsReadAccess() and needsWriteAccess() in the handler and calls i...
A factory for MWBasicRequestAuthorizer which passes through a UserIdentity.
__construct(UserIdentity $user, PermissionManager $permissionManager)
createRequestAuthorizer(RequestInterface $request, Handler $handler)
Create a BasicRequestAuthorizer to authorize the request.
The concrete implementation of basic read/write restrictions in MediaWiki.
return[ 'OATHAuth'=> function(MediaWikiServices $services) { return new OATHAuth($services->getMainConfig(), $services->getDBLoadBalancerFactory());}, 'OATHUserRepository'=> function(MediaWikiServices $services) { global $wgOATHAuthDatabase;$auth=$services->getService( 'OATHAuth');return new OATHUserRepository($services->getDBLoadBalancerFactory() ->getMainLB( $wgOATHAuthDatabase), new \HashBagOStuff(['maxKey'=> 5]), $auth);}]
A request interface similar to PSR-7's ServerRequestInterface.
Interface for objects representing user identity.