Skip to content

Commit

Permalink
[kbss-cvut/record-manager-ui#202] Fix the access control to allow ROL…
Browse files Browse the repository at this point in the history
…E_USER access to institution retrieval
  • Loading branch information
palagdan committed Dec 11, 2024
1 parent fad3222 commit 9c56d49
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ public User getByUsername(@PathVariable("username") String username) {

@PreAuthorize(
"hasAuthority('" + SecurityConstants.ROLE_ADMIN + "') " +
"or hasAuthority('" + SecurityConstants.ROLE_ADMIN + "') and @securityUtils.isMemberOfInstitution(#institutionKey)")
"or hasAuthority('" + SecurityConstants.ROLE_USER + "') and @securityUtils.isMemberOfInstitution(#institutionKey)")
@GetMapping(produces = MediaType.APPLICATION_JSON_VALUE)
public List<User> getUsers(@RequestParam(value = "institution", required = false) String institutionKey) {
return institutionKey != null ? getByInstitution(institutionKey) : userService.findAll();
Expand Down

0 comments on commit 9c56d49

Please sign in to comment.