Bristol SU Support Package
src
Authorization
Middleware
CheckAdminIsAtLeastUser.php
Go to the documentation of this file.
1
<?php
2
3
namespace
BristolSU\Support\Authorization\Middleware
;
4
5
use
BristolSU\Support\Authentication\Contracts\Authentication
;
6
use
BristolSU\Support\User\Contracts\UserAuthentication
;
7
use
Illuminate\Http\Request
;
8
9
class
CheckAdminIsAtLeastUser
10
{
11
15
private
$authentication
;
19
private
$userAuthentication
;
20
21
public
function
__construct
(
Authentication
$authentication
,
UserAuthentication
$userAuthentication
)
22
{
23
$this->authentication =
$authentication
;
24
$this->userAuthentication =
$userAuthentication
;
25
}
26
34
public
function
handle
(Request $request, \
Closure
$next)
35
{
36
if
($this->authentication->getUser() === null) {
37
$this->authentication->setUser(
38
$this->userAuthentication->getUser()->controlUser()
39
);
40
}
41
return
$next($request);
42
}
43
44
}
BristolSU\Support\Authorization\Middleware\CheckAdminIsAtLeastUser\$authentication
$authentication
Definition:
CheckAdminIsAtLeastUser.php:15
BristolSU\Support\Authorization\Middleware\CheckAdminIsAtLeastUser\__construct
__construct(Authentication $authentication, UserAuthentication $userAuthentication)
Definition:
CheckAdminIsAtLeastUser.php:21
BristolSU\Support\Authentication\Contracts\Authentication
Definition:
Authentication.php:15
BristolSU\Support\Authorization\Middleware
Definition:
CheckActivityEnabled.php:3
Closure
BristolSU\Support\User\Contracts\UserAuthentication
Definition:
UserAuthentication.php:10
BristolSU\Support\Authorization\Middleware\CheckAdminIsAtLeastUser\$userAuthentication
$userAuthentication
Definition:
CheckAdminIsAtLeastUser.php:19
Authentication
BristolSU\Support\Authorization\Middleware\CheckAdminIsAtLeastUser\handle
handle(Request $request, \Closure $next)
Definition:
CheckAdminIsAtLeastUser.php:34
Request
UserAuthentication
BristolSU\Support\Authorization\Middleware\CheckAdminIsAtLeastUser
Definition:
CheckAdminIsAtLeastUser.php:9
Generated by
1.8.13