1 | <?php |
||
11 | trait AuthorizationAware |
||
12 | { |
||
13 | /** |
||
14 | * @var AuthorizationCheckerInterface |
||
15 | */ |
||
16 | protected $authorizationChecker; |
||
17 | |||
18 | /** |
||
19 | * @return AuthorizationCheckerInterface |
||
20 | */ |
||
21 | public function getAuthorizationChecker() |
||
25 | |||
26 | /** |
||
27 | * @param AuthorizationCheckerInterface $authorizationChecker |
||
28 | */ |
||
29 | public function setAuthorizationChecker(AuthorizationCheckerInterface $authorizationChecker) |
||
33 | |||
34 | /** |
||
35 | * Checks if the attributes are granted against the current authentication token and optionally supplied object. |
||
36 | * |
||
37 | * @param mixed $attributes The attributes |
||
38 | * @param mixed $object The object |
||
39 | * |
||
40 | * @throws LogicException |
||
41 | * |
||
42 | * @return bool |
||
43 | */ |
||
44 | protected function isGranted($attributes, $object = null) |
||
48 | |||
49 | /** |
||
50 | * Throws an exception unless the attributes are granted against the current authentication token and optionally |
||
51 | * supplied object. |
||
52 | * |
||
53 | * @param mixed $attributes The attributes |
||
54 | * @param mixed $object The object |
||
55 | * @param string $message The message passed to the exception |
||
56 | * |
||
57 | * @throws AccessDeniedException |
||
58 | */ |
||
59 | protected function denyAccessUnlessGranted($attributes, $object = null, $message = 'Access Denied.') |
||
65 | } |
||
66 |