| @@ 137-150 (lines=14) @@ | ||
| 134 | * |
|
| 135 | * @return Response |
|
| 136 | */ |
|
| 137 | public function createNotAuthorized( |
|
| 138 | string $type, |
|
| 139 | array $arguments, |
|
| 140 | string $accept, |
|
| 141 | NormalizerContextInterface $context = null |
|
| 142 | ): Response { |
|
| 143 | return $this->createByError(new Error( |
|
| 144 | Error::SCOPE_HEADER, |
|
| 145 | 'permission_denied', |
|
| 146 | 'authenticated client/user is not allowed to perform this action', |
|
| 147 | $type, |
|
| 148 | $arguments |
|
| 149 | ), $accept, 403, $context); |
|
| 150 | } |
|
| 151 | ||
| 152 | /** |
|
| 153 | * @param string $type |
|
| @@ 160-173 (lines=14) @@ | ||
| 157 | * |
|
| 158 | * @return Response |
|
| 159 | */ |
|
| 160 | public function createResourceNotFound( |
|
| 161 | string $type, |
|
| 162 | array $arguments, |
|
| 163 | string $accept, |
|
| 164 | NormalizerContextInterface $context = null |
|
| 165 | ): Response { |
|
| 166 | return $this->createByError(new Error( |
|
| 167 | Error::SCOPE_RESOURCE, |
|
| 168 | 'resource_not_found', |
|
| 169 | 'the requested resource cannot be found', |
|
| 170 | $type, |
|
| 171 | $arguments |
|
| 172 | ), $accept, 404, $context); |
|
| 173 | } |
|
| 174 | ||
| 175 | /** |
|
| 176 | * @param Request $request |
|