From a3e4cc3e04bbe6ed41438778b5c4853c6e23df70 Mon Sep 17 00:00:00 2001 From: paul-lawlor-tco <145372589+paul-lawlor-tco@users.noreply.github.com> Date: Tue, 16 Apr 2024 13:39:14 +0100 Subject: [PATCH] GAP-2523 (#201) * Give super admin access to relevant method * Give SUPER ADMIN access to relevant method * Revert "Give SUPER ADMIN access to relevant method" This reverts commit dbe7b3619a1376881501c4f7d7e6e1f06687cc5c. --- .../gov/cabinetoffice/gapuserservice/web/UserController.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/gov/cabinetoffice/gapuserservice/web/UserController.java b/src/main/java/gov/cabinetoffice/gapuserservice/web/UserController.java index cd5461ee..d0975db4 100644 --- a/src/main/java/gov/cabinetoffice/gapuserservice/web/UserController.java +++ b/src/main/java/gov/cabinetoffice/gapuserservice/web/UserController.java @@ -170,7 +170,7 @@ public ResponseEntity> getUserEmailsFromSubs( @GetMapping("/user/email/{email}") - @PreAuthorize("hasRole('ADMIN')") + @PreAuthorize("hasAnyRole('ADMIN', 'SUPER_ADMIN')") public ResponseEntity getUserByEmail(@PathVariable("email") String email, @RequestParam Optional role) { return ResponseEntity.ok( role.map(s -> new UserDto(oneLoginUserService.getUserByEmailAndRole(email, s)))