@@ -255,26 +255,26 @@ |
||
| 255 | 255 | * @NoAdminRequired |
| 256 | 256 | */ |
| 257 | 257 | public function getRevision($credential_guid) { |
| 258 | - try { |
|
| 259 | - $credential = $this->credentialService->getCredentialByGUID($credential_guid); |
|
| 260 | - } |
|
| 261 | - catch (DoesNotExistException $ex){ |
|
| 262 | - return new NotFoundJSONResponse(); |
|
| 263 | - } |
|
| 258 | + try { |
|
| 259 | + $credential = $this->credentialService->getCredentialByGUID($credential_guid); |
|
| 260 | + } |
|
| 261 | + catch (DoesNotExistException $ex){ |
|
| 262 | + return new NotFoundJSONResponse(); |
|
| 263 | + } |
|
| 264 | 264 | |
| 265 | - // If the request was made by the owner of the credential |
|
| 266 | - if ($this->userId === $credential->getUserId()) { |
|
| 267 | - $result = $this->credentialRevisionService->getRevisions($credential->getId(), $this->userId); |
|
| 268 | - } |
|
| 269 | - else { |
|
| 270 | - $acl = $this->sharingService->getACL($this->userId, $credential_guid); |
|
| 271 | - if ($acl->hasPermission(SharingACL::HISTORY)){ |
|
| 272 | - $result = $this->credentialRevisionService->getRevisions($credential->getId()); |
|
| 273 | - } |
|
| 274 | - else { |
|
| 275 | - return new NotFoundJSONResponse(); |
|
| 276 | - } |
|
| 277 | - } |
|
| 265 | + // If the request was made by the owner of the credential |
|
| 266 | + if ($this->userId === $credential->getUserId()) { |
|
| 267 | + $result = $this->credentialRevisionService->getRevisions($credential->getId(), $this->userId); |
|
| 268 | + } |
|
| 269 | + else { |
|
| 270 | + $acl = $this->sharingService->getACL($this->userId, $credential_guid); |
|
| 271 | + if ($acl->hasPermission(SharingACL::HISTORY)){ |
|
| 272 | + $result = $this->credentialRevisionService->getRevisions($credential->getId()); |
|
| 273 | + } |
|
| 274 | + else { |
|
| 275 | + return new NotFoundJSONResponse(); |
|
| 276 | + } |
|
| 277 | + } |
|
| 278 | 278 | |
| 279 | 279 | return new JSONResponse($result); |
| 280 | 280 | } |