Skip to content

Commit

Permalink
[SHIBUI-1058]
Browse files Browse the repository at this point in the history
check to see if the item is already enabled for the user
  • Loading branch information
jj committed Feb 19, 2019
1 parent 2dd5be8 commit 87ded49
Showing 1 changed file with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -122,9 +122,11 @@ public ResponseEntity<?> update(@RequestBody EntityDescriptorRepresentation edRe
return ResponseEntity.notFound().build();
} else {
if (currentUser != null && (currentUser.getRole().equals("ROLE_ADMIN") || currentUser.getUsername().equals(existingEd.getCreatedBy()))) {
ResponseEntity<?> entityDescriptorEnablingDeniedResponse = entityDescriptorEnablePermissionsCheck(edRepresentation.isServiceEnabled());
if (entityDescriptorEnablingDeniedResponse != null) {
return entityDescriptorEnablingDeniedResponse;
if (!existingEd.isServiceEnabled()) {
ResponseEntity<?> entityDescriptorEnablingDeniedResponse = entityDescriptorEnablePermissionsCheck(edRepresentation.isServiceEnabled());
if (entityDescriptorEnablingDeniedResponse != null) {
return entityDescriptorEnablingDeniedResponse;
}
}

// Verify we're the only one attempting to update the EntityDescriptor
Expand Down

0 comments on commit 87ded49

Please sign in to comment.