@@ 146-159 (lines=14) @@ | ||
143 | * |
|
144 | * @return Response |
|
145 | */ |
|
146 | public function createNotAuthorized( |
|
147 | string $type, |
|
148 | array $arguments, |
|
149 | string $accept, |
|
150 | NormalizerContext $context = null |
|
151 | ): Response { |
|
152 | return $this->createByError(new Error( |
|
153 | Error::SCOPE_HEADER, |
|
154 | 'permission_denied', |
|
155 | 'authenticated client/user is not allowed to perform this action', |
|
156 | $type, |
|
157 | $arguments |
|
158 | ), $accept, 403, $context); |
|
159 | } |
|
160 | ||
161 | /** |
|
162 | * @param string $type |
|
@@ 169-182 (lines=14) @@ | ||
166 | * |
|
167 | * @return Response |
|
168 | */ |
|
169 | public function createResourceNotFound( |
|
170 | string $type, |
|
171 | array $arguments, |
|
172 | string $accept, |
|
173 | NormalizerContext $context = null |
|
174 | ): Response { |
|
175 | return $this->createByError(new Error( |
|
176 | Error::SCOPE_RESOURCE, |
|
177 | 'resource_not_found', |
|
178 | 'the requested resource cannot be found', |
|
179 | $type, |
|
180 | $arguments |
|
181 | ), $accept, 404, $context); |
|
182 | } |
|
183 | ||
184 | /** |
|
185 | * @param Request $request |