1 | <?php |
||
19 | trait ControllerSecurityTrait |
||
20 | { |
||
21 | /** |
||
22 | * @var AuthorizationCheckerInterface |
||
23 | */ |
||
24 | private $authorizationChecker; |
||
25 | |||
26 | /** |
||
27 | * @var TokenStorageInterface |
||
28 | */ |
||
29 | private $tokenStorage; |
||
30 | |||
31 | /** |
||
32 | * @var CsrfTokenManagerInterface |
||
33 | */ |
||
34 | private $csrfTokenManager; |
||
35 | |||
36 | public function setAuthorizationChecker(AuthorizationCheckerInterface $authorizationChecker) |
||
40 | |||
41 | public function setTokenStorage(TokenStorageInterface $tokenStorage) |
||
45 | |||
46 | public function setCsrfTokenManager(CsrfTokenManagerInterface $csrfTokenManager) |
||
50 | |||
51 | /** |
||
52 | * @param mixed $attributes |
||
53 | * @param mixed $object |
||
54 | */ |
||
55 | protected function isGranted($attributes, $object = null) : bool |
||
59 | |||
60 | /** |
||
61 | * @param mixed $attributes |
||
62 | * @param mixed $object |
||
63 | * @param string $message |
||
64 | */ |
||
65 | protected function denyAccessUnlessGranted($attributes, $object = null, string $message = 'Access Denied.') |
||
71 | |||
72 | /** |
||
73 | * @return object|void|UserInterface |
||
74 | */ |
||
75 | protected function getUser() |
||
91 | |||
92 | protected function isCsrfTokenValid(string $id, string $token) : bool |
||
96 | } |
||
97 |