1 | <?php |
||
17 | trait CheckAccessTrait |
||
18 | { |
||
19 | /** |
||
20 | * @var int|null |
||
21 | */ |
||
22 | public $statusCodeUnauthorized; |
||
23 | |||
24 | /** |
||
25 | * @var string|null |
||
26 | */ |
||
27 | public $messageUnauthorized; |
||
28 | |||
29 | /** |
||
30 | * @var null|callable |
||
31 | */ |
||
32 | public $checkAccess = null; |
||
33 | |||
34 | /** |
||
35 | * @param mixed ...$params |
||
36 | * @return mixed |
||
37 | * @throws UnauthorizedHttpException |
||
38 | */ |
||
39 | public function checkAccess(...$params) |
||
50 | |||
51 | /** |
||
52 | * HTTP forbidden response code |
||
53 | * |
||
54 | * @return int |
||
55 | */ |
||
56 | protected function statusCodeUnauthorized(): int |
||
60 | |||
61 | /** |
||
62 | * @return string |
||
63 | */ |
||
64 | protected function messageUnauthorized(): string |
||
68 | |||
69 | /** |
||
70 | * @throws UnauthorizedHttpException |
||
71 | */ |
||
72 | protected function handleUnauthorizedResponse() |
||
79 | } |
||
80 |