1 | <?php declare(strict_types=1); |
||
34 | trait AuthorizationRulesTrait |
||
35 | { |
||
36 | 1 | /** |
|
37 | * @param ContextInterface $context |
||
38 | 1 | * |
|
39 | * @return bool |
||
40 | */ |
||
41 | protected static function reqHasAction(ContextInterface $context): bool |
||
45 | |||
46 | 1 | /** |
|
47 | * @param ContextInterface $context |
||
48 | 1 | * |
|
49 | * @return string |
||
50 | 1 | */ |
|
51 | protected static function reqGetAction(ContextInterface $context): string |
||
59 | |||
60 | 1 | /** |
|
61 | * @param ContextInterface $context |
||
62 | 1 | * |
|
63 | * @return bool |
||
64 | */ |
||
65 | protected static function reqHasResourceType(ContextInterface $context): bool |
||
69 | |||
70 | 1 | /** |
|
71 | * @param ContextInterface $context |
||
72 | 1 | * |
|
73 | * @return string|null |
||
74 | 1 | */ |
|
75 | protected static function reqGetResourceType(ContextInterface $context): ?string |
||
85 | |||
86 | 1 | /** |
|
87 | * @param ContextInterface $context |
||
88 | 1 | * |
|
89 | * @return bool |
||
90 | */ |
||
91 | protected static function reqHasResourceIdentity(ContextInterface $context): bool |
||
95 | |||
96 | 1 | /** |
|
97 | * @param ContextInterface $context |
||
98 | 1 | * |
|
99 | * @return string|null |
||
100 | 1 | */ |
|
101 | protected static function reqGetResourceIdentity(ContextInterface $context): ?string |
||
111 | |||
112 | 1 | /** |
|
113 | * @param ContextInterface $context |
||
114 | 1 | * |
|
115 | * @return bool |
||
116 | */ |
||
117 | protected static function reqHasResourceAttributes(ContextInterface $context): bool |
||
121 | |||
122 | 1 | /** |
|
123 | * @param ContextInterface $context |
||
124 | 1 | * |
|
125 | * @return string|int|array|null |
||
126 | 1 | */ |
|
127 | protected static function reqGetResourceAttributes(ContextInterface $context): array |
||
137 | |||
138 | 1 | /** |
|
139 | * @param ContextInterface $context |
||
140 | 1 | * |
|
141 | * @return bool |
||
142 | */ |
||
143 | protected static function reqHasResourceRelationships(ContextInterface $context): bool |
||
147 | |||
148 | 1 | /** |
|
149 | * @param ContextInterface $context |
||
150 | 1 | * |
|
151 | * @return string|int|array|null |
||
152 | 1 | */ |
|
153 | protected static function reqGetResourceRelationships(ContextInterface $context): array |
||
163 | |||
164 | /** |
||
165 | * @param ContextInterface $context |
||
166 | * |
||
167 | 1 | * @return bool |
|
168 | * |
||
169 | * @throws ContainerExceptionInterface |
||
170 | 1 | * @throws NotFoundExceptionInterface |
|
171 | 1 | */ |
|
172 | 1 | protected static function ctxHasCurrentAccount(ContextInterface $context): bool |
|
181 | |||
182 | /** |
||
183 | * @param ContextInterface $context |
||
184 | * |
||
185 | 1 | * @return AccountInterface |
|
186 | * |
||
187 | 1 | * @throws ContainerExceptionInterface |
|
188 | * @throws NotFoundExceptionInterface |
||
189 | */ |
||
190 | 1 | protected static function ctxGetCurrentAccount(ContextInterface $context): AccountInterface |
|
201 | |||
202 | 1 | /** |
|
203 | * @param ContextInterface $context |
||
204 | 1 | * |
|
205 | * @return bool |
||
206 | */ |
||
207 | protected static function ctxHasContainer(ContextInterface $context): bool |
||
211 | |||
212 | 1 | /** |
|
213 | * @param ContextInterface $context |
||
214 | 1 | * |
|
215 | * @return ContainerInterface |
||
216 | 1 | */ |
|
217 | protected static function ctxGetContainer(ContextInterface $context): ContainerInterface |
||
223 | } |
||
224 |