From 581da3845132de3ec5f2f01fbe54c634b49f1adb Mon Sep 17 00:00:00 2001 From: Guillaume Poirier-Morency Date: Thu, 4 May 2023 10:16:36 -0700 Subject: [PATCH] Use hasAuthority() instead of hasRole() They are currently equivalent, but in Spring 4, hasRole() will prefix authorities with 'ROLE_'. Relates to #508. --- .../main/java/ubic/gemma/rest/RootWebService.java | 2 +- .../src/main/webapp/common/userStatusVariables.jsp | 12 ++++++------ .../src/main/webapp/pages/admin/activeUsers.jsp | 4 ++-- gemma-web/src/main/webapp/pages/admin/indexer.jsp | 2 +- .../main/webapp/pages/admin/reIndexOntologies.jsp | 2 +- .../src/main/webapp/pages/admin/systemStats.jsp | 2 +- gemma-web/src/main/webapp/pages/bibRefView.jsp | 2 +- gemma-web/src/main/webapp/pages/characteristics.jsp | 2 +- gemma-web/src/main/webapp/pages/error/500.jsp | 6 +++--- 9 files changed, 17 insertions(+), 17 deletions(-) diff --git a/gemma-rest/src/main/java/ubic/gemma/rest/RootWebService.java b/gemma-rest/src/main/java/ubic/gemma/rest/RootWebService.java index a12c1a001a..4d04face94 100644 --- a/gemma-rest/src/main/java/ubic/gemma/rest/RootWebService.java +++ b/gemma-rest/src/main/java/ubic/gemma/rest/RootWebService.java @@ -101,7 +101,7 @@ public ResponseDataObject getApiInfo( // Params: @GET @Path("/users/{username}") @Produces(MediaType.APPLICATION_JSON) - @PreAuthorize("(isAuthenticated() && principal.username == #username) || hasRole('GROUP_ADMIN')") + @PreAuthorize("(isAuthenticated() && principal.username == #username) || hasAuthority('GROUP_ADMIN')") @Operation(summary = "Retrieve the user information associated to the authenticated session", hidden = true) public ResponseDataObject getUser( // Params: @PathParam("username") String username // Required diff --git a/gemma-web/src/main/webapp/common/userStatusVariables.jsp b/gemma-web/src/main/webapp/common/userStatusVariables.jsp index a3cadd157d..29ab29fdaf 100644 --- a/gemma-web/src/main/webapp/common/userStatusVariables.jsp +++ b/gemma-web/src/main/webapp/common/userStatusVariables.jsp @@ -2,22 +2,22 @@ <%-- Security fields used in Java script calls to hide or display information on pages, used to be in footer --%> - + - + - + - + - + - + diff --git a/gemma-web/src/main/webapp/pages/admin/activeUsers.jsp b/gemma-web/src/main/webapp/pages/admin/activeUsers.jsp index 95f9ea33d7..f189cafe4f 100644 --- a/gemma-web/src/main/webapp/pages/admin/activeUsers.jsp +++ b/gemma-web/src/main/webapp/pages/admin/activeUsers.jsp @@ -20,7 +20,7 @@

- +
Signed in: ?
@@ -38,7 +38,7 @@

FIXME table of authenticated users should go here.

System Stats

- + Gemma version ${appConfig['version']}