| @@ 355-363 (lines=9) @@ | ||
| 352 | * |
|
| 353 | * @return null|SS_HTTPResponse |
|
| 354 | */ |
|
| 355 | protected function validateDeployment(\DNDeployment $deployment) { |
|
| 356 | if (!$deployment || !$deployment->exists()) { |
|
| 357 | return $this->getAPIResponse(['message' => 'This deployment does not exist'], 404); |
|
| 358 | } |
|
| 359 | if (!$deployment->canView()) { |
|
| 360 | return $this->getAPIResponse(['message' => 'You are not authorised to view this deployment'], 403); |
|
| 361 | } |
|
| 362 | return null; |
|
| 363 | } |
|
| 364 | ||
| 365 | } |
|
| 366 | ||
| @@ 204-212 (lines=9) @@ | ||
| 201 | * |
|
| 202 | * @return null|SS_HTTPResponse |
|
| 203 | */ |
|
| 204 | protected function validateDeployment(\DNDeployment $deployment) { |
|
| 205 | if (!$deployment || !$deployment->exists()) { |
|
| 206 | return $this->getAPIResponse(['message' => 'This deployment does not exist'], 404); |
|
| 207 | } |
|
| 208 | if (!$deployment->canView()) { |
|
| 209 | return $this->getAPIResponse(['message' => 'You are not authorised to view this deployment'], 403); |
|
| 210 | } |
|
| 211 | return null; |
|
| 212 | } |
|
| 213 | ||
| 214 | protected function canApprove(Member $member = null) { |
|
| 215 | if (!$member) { |
|