From a176f7b1b3a6e61e40fbb7bec8a33f97ba68a4eb Mon Sep 17 00:00:00 2001 From: Pekka Helenius Date: Sat, 3 Oct 2020 03:55:06 +0300 Subject: [PATCH] Simplify access control annotations, based on Spring docs Ref: https://docs.spring.io/spring-security/site/docs/4.2.x/reference/html/el-access.html Signed-off-by: Pekka Helenius --- .../java/com/fjordtek/bookstore/web/BookController.java | 4 ++-- bookstore/src/main/resources/templates/booklist.html | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/bookstore/src/main/java/com/fjordtek/bookstore/web/BookController.java b/bookstore/src/main/java/com/fjordtek/bookstore/web/BookController.java index ff1d6a4..22eae35 100644 --- a/bookstore/src/main/java/com/fjordtek/bookstore/web/BookController.java +++ b/bookstore/src/main/java/com/fjordtek/bookstore/web/BookController.java @@ -249,7 +249,7 @@ public class BookController { ////////////////////////////// // UPDATE BOOK - @PreAuthorize("hasAuthority('MARKETING') or hasAuthority('HELPDESK')") + @PreAuthorize("hasAnyAuthority('MARKETING', 'HELPDESK')") @RequestMapping( value = bookEditPageView + "/{hash_id}", method = RequestMethod.GET @@ -284,7 +284,7 @@ public class BookController { * Internally, we never use URL id as a reference for user modifications, * but just as an URL end point. */ - @PreAuthorize("hasAuthority('MARKETING') or hasAuthority('HELPDESK')") + @PreAuthorize("hasAnyAuthority('MARKETING', 'HELPDESK')") @RequestMapping( value = bookEditPageView + "/{hash_id}", method = RequestMethod.POST diff --git a/bookstore/src/main/resources/templates/booklist.html b/bookstore/src/main/resources/templates/booklist.html index 57d8884..de092b9 100644 --- a/bookstore/src/main/resources/templates/booklist.html +++ b/bookstore/src/main/resources/templates/booklist.html @@ -89,12 +89,12 @@ Idea of the following syntax used in this and other HTML document: page.text.list.actions - + @@ -178,7 +178,7 @@ Idea of the following syntax used in this and other HTML document: - page.text.list.edit