@@ -70,12 +70,12 @@ |
||
| 70 | 70 | public function getModel($name = '') { |
| 71 | 71 | $base = Director::absoluteBaseURL(); |
| 72 | 72 | return [ |
| 73 | - 'basename' => Director::baseURL() . $this->getCurrentEnvironment()->Link('overview'), |
|
| 73 | + 'basename' => Director::baseURL().$this->getCurrentEnvironment()->Link('overview'), |
|
| 74 | 74 | 'dispatchers' => [ |
| 75 | - 'git' => $base . $this->getCurrentProject()->Link('git'), |
|
| 76 | - 'plan' => $base . $this->getCurrentEnvironment()->Link('plan'), |
|
| 77 | - 'deploys' => $base . $this->getCurrentEnvironment()->Link('deploys'), |
|
| 78 | - 'approvals' => $base . $this->getCurrentEnvironment()->Link('approvals') |
|
| 75 | + 'git' => $base.$this->getCurrentProject()->Link('git'), |
|
| 76 | + 'plan' => $base.$this->getCurrentEnvironment()->Link('plan'), |
|
| 77 | + 'deploys' => $base.$this->getCurrentEnvironment()->Link('deploys'), |
|
| 78 | + 'approvals' => $base.$this->getCurrentEnvironment()->Link('approvals') |
|
| 79 | 79 | ], |
| 80 | 80 | 'api_auth' => [ |
| 81 | 81 | 'name' => $this->getSecurityToken()->getName(), |
@@ -172,9 +172,11 @@ |
||
| 172 | 172 | return $errorResponse; |
| 173 | 173 | } |
| 174 | 174 | |
| 175 | - if (!$this->project->allowed(self::ALLOW_APPROVAL, Member::currentUser))) { |
|
| 175 | + if (!$this->project->allowed(self::ALLOW_APPROVAL, Member::currentUser)) { |
|
| 176 | + ) { |
|
| 176 | 177 | return $this->getAPIResponse(['message' => 'You are not authorised to approve this deployment'], 403); |
| 177 | 178 | } |
| 179 | + } |
|
| 178 | 180 | |
| 179 | 181 | try { |
| 180 | 182 | $deployment->getMachine()->apply(DNDeployment::TR_APPROVE); |