1 | <?php namespace Limoncello\Application\Authorization; |
||
29 | trait AuthorizationRulesTrait |
||
30 | { |
||
31 | /** |
||
32 | * @param ContextInterface $context |
||
33 | * |
||
34 | * @return bool |
||
35 | */ |
||
36 | protected static function reqHasAction(ContextInterface $context): bool |
||
40 | |||
41 | /** |
||
42 | * @param ContextInterface $context |
||
43 | * |
||
44 | * @return string |
||
45 | */ |
||
46 | protected static function reqGetAction(ContextInterface $context): string |
||
54 | |||
55 | /** |
||
56 | * @param ContextInterface $context |
||
57 | * |
||
58 | * @return bool |
||
59 | */ |
||
60 | protected static function reqHasResourceType(ContextInterface $context): bool |
||
64 | |||
65 | /** |
||
66 | * @param ContextInterface $context |
||
67 | * |
||
68 | * @return string|null |
||
69 | */ |
||
70 | protected static function reqGetResourceType(ContextInterface $context): ?string |
||
80 | |||
81 | /** |
||
82 | * @param ContextInterface $context |
||
83 | * |
||
84 | * @return bool |
||
85 | */ |
||
86 | protected static function reqHasResourceIdentity(ContextInterface $context): bool |
||
90 | |||
91 | /** |
||
92 | * @param ContextInterface $context |
||
93 | * |
||
94 | * @return string|int|array|null |
||
95 | */ |
||
96 | protected static function reqGetResourceIdentity(ContextInterface $context) |
||
106 | |||
107 | /** |
||
108 | * @param ContextInterface $context |
||
109 | * |
||
110 | * @return bool |
||
111 | */ |
||
112 | protected static function reqHasResourceAttributes(ContextInterface $context): bool |
||
116 | |||
117 | /** |
||
118 | * @param ContextInterface $context |
||
119 | * |
||
120 | * @return string|int|array|null |
||
121 | */ |
||
122 | protected static function reqGetResourceAttributes(ContextInterface $context): array |
||
132 | |||
133 | /** |
||
134 | * @param ContextInterface $context |
||
135 | * |
||
136 | * @return bool |
||
137 | */ |
||
138 | protected static function reqHasResourceRelationships(ContextInterface $context): bool |
||
142 | |||
143 | /** |
||
144 | * @param ContextInterface $context |
||
145 | * |
||
146 | * @return string|int|array|null |
||
147 | */ |
||
148 | protected static function reqGetResourceRelationships(ContextInterface $context): array |
||
158 | |||
159 | /** |
||
160 | * @param ContextInterface $context |
||
161 | * |
||
162 | * @return bool |
||
163 | * |
||
164 | * @throws ContainerExceptionInterface |
||
165 | * @throws NotFoundExceptionInterface |
||
166 | */ |
||
167 | protected static function ctxHasCurrentAccount(ContextInterface $context): bool |
||
176 | |||
177 | /** |
||
178 | * @param ContextInterface $context |
||
179 | * |
||
180 | * @return AccountInterface |
||
181 | * |
||
182 | * @throws ContainerExceptionInterface |
||
183 | * @throws NotFoundExceptionInterface |
||
184 | */ |
||
185 | protected static function ctxGetCurrentAccount(ContextInterface $context): AccountInterface |
||
196 | |||
197 | /** |
||
198 | * @param ContextInterface $context |
||
199 | * |
||
200 | * @return bool |
||
201 | */ |
||
202 | protected static function ctxHasContainer(ContextInterface $context): bool |
||
206 | |||
207 | /** |
||
208 | * @param ContextInterface $context |
||
209 | * |
||
210 | * @return ContainerInterface |
||
211 | */ |
||
212 | protected static function ctxGetContainer(ContextInterface $context): ContainerInterface |
||
218 | } |
||
219 |