@@ -255,21 +255,18 @@ |
||
| 255 | 255 | public function getRevision($credential_guid) { |
| 256 | 256 | try { |
| 257 | 257 | $credential = $this->credentialService->getCredentialByGUID($credential_guid); |
| 258 | - } |
|
| 259 | - catch (DoesNotExistException $ex) { |
|
| 258 | + } catch (DoesNotExistException $ex) { |
|
| 260 | 259 | return new NotFoundJSONResponse(); |
| 261 | 260 | } |
| 262 | 261 | |
| 263 | 262 | // If the request was made by the owner of the credential |
| 264 | 263 | if ($this->userId === $credential->getUserId()) { |
| 265 | 264 | $result = $this->credentialRevisionService->getRevisions($credential->getId(), $this->userId); |
| 266 | - } |
|
| 267 | - else { |
|
| 265 | + } else { |
|
| 268 | 266 | $acl = $this->sharingService->getACL($this->userId, $credential_guid); |
| 269 | 267 | if ($acl->hasPermission(SharingACL::HISTORY)) { |
| 270 | 268 | $result = $this->credentialRevisionService->getRevisions($credential->getId()); |
| 271 | - } |
|
| 272 | - else { |
|
| 269 | + } else { |
|
| 273 | 270 | return new NotFoundJSONResponse(); |
| 274 | 271 | } |
| 275 | 272 | } |
@@ -61,8 +61,7 @@ |
||
| 61 | 61 | $filter = [$item_guid]; |
| 62 | 62 | if ($user_id === null){ |
| 63 | 63 | $q .= 'user_id is null'; |
| 64 | - } |
|
| 65 | - else { |
|
| 64 | + } else { |
|
| 66 | 65 | $q .= 'user_id = ? '; |
| 67 | 66 | $filter[] = $user_id; |
| 68 | 67 | } |