| @@ 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 | ||
| @@ 186-194 (lines=9) @@ | ||
| 183 | * |
|
| 184 | * @return null|SS_HTTPResponse |
|
| 185 | */ |
|
| 186 | protected function validateDeployment(\DNDeployment $deployment) { |
|
| 187 | if (!$deployment || !$deployment->exists()) { |
|
| 188 | return $this->getAPIResponse(['message' => 'This deployment does not exist'], 404); |
|
| 189 | } |
|
| 190 | if (!$deployment->canView()) { |
|
| 191 | return $this->getAPIResponse(['message' => 'You are not authorised to view this deployment'], 403); |
|
| 192 | } |
|
| 193 | return null; |
|
| 194 | } |
|
| 195 | ||
| 196 | protected function canApprove(Member $member = null) { |
|
| 197 | if (!$member) { |
|