| @@ 152-160 (lines=9) @@ | ||
| 149 | * |
|
| 150 | * @return null|SS_HTTPResponse |
|
| 151 | */ |
|
| 152 | protected function validateDeployment(\DNDeployment $deployment) { |
|
| 153 | if (!$deployment || !$deployment->exists()) { |
|
| 154 | return $this->getAPIResponse(['message' => 'This deployment does not exist'], 404); |
|
| 155 | } |
|
| 156 | if (!$deployment->canView()) { |
|
| 157 | return $this->getAPIResponse(['message' => 'You are not authorised to view this deployment'], 403); |
|
| 158 | } |
|
| 159 | return null; |
|
| 160 | } |
|
| 161 | ||
| 162 | protected function canApprove(Member $member = null) { |
|
| 163 | if (!$member) { |
|
| @@ 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 | ||