| @@ 263-274 (lines=12) @@ | ||
| 260 | * |
|
| 261 | * @return null|SS_HTTPResponse |
|
| 262 | */ |
|
| 263 | protected function validateDeployment(\DNDeployment $deployment) { |
|
| 264 | if (!$deployment || !$deployment->exists()) { |
|
| 265 | return $this->getAPIResponse(['message' => 'This deployment does not exist'], 404); |
|
| 266 | } |
|
| 267 | if ($deployment->EnvironmentID != $this->environment->ID) { |
|
| 268 | return $this->getAPIResponse(['message' => 'This deployment does not belong to the environment'], 403); |
|
| 269 | } |
|
| 270 | if (!$deployment->canView()) { |
|
| 271 | return $this->getAPIResponse(['message' => 'You are not authorised to view this deployment'], 403); |
|
| 272 | } |
|
| 273 | return null; |
|
| 274 | } |
|
| 275 | ||
| 276 | } |
|
| 277 | ||
| @@ 274-285 (lines=12) @@ | ||
| 271 | * |
|
| 272 | * @return null|SS_HTTPResponse |
|
| 273 | */ |
|
| 274 | protected function validateDeployment(\DNDeployment $deployment) { |
|
| 275 | if (!$deployment || !$deployment->exists()) { |
|
| 276 | return $this->getAPIResponse(['message' => 'This deployment does not exist'], 404); |
|
| 277 | } |
|
| 278 | if ($deployment->EnvironmentID != $this->environment->ID) { |
|
| 279 | return $this->getAPIResponse(['message' => 'This deployment does not belong to the environment'], 403); |
|
| 280 | } |
|
| 281 | if (!$deployment->canView()) { |
|
| 282 | return $this->getAPIResponse(['message' => 'You are not authorised to view this deployment'], 403); |
|
| 283 | } |
|
| 284 | return null; |
|
| 285 | } |
|
| 286 | ||
| 287 | /** |
|
| 288 | * @param string $name |
|