From ac02bad77070c342f9bc2451ff72685da7b453ba Mon Sep 17 00:00:00 2001 From: Pekka Helenius Date: Tue, 6 Oct 2020 23:51:50 +0300 Subject: [PATCH] Update controller links & authorities Signed-off-by: Pekka Helenius --- .../main/java/com/fjordtek/bookstore/web/BookController.java | 2 +- .../java/com/fjordtek/bookstore/web/BookRestController.java | 4 ++-- 2 files changed, 3 insertions(+), 3 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 2eb14cf..e1b413c 100644 --- a/bookstore/src/main/java/com/fjordtek/bookstore/web/BookController.java +++ b/bookstore/src/main/java/com/fjordtek/bookstore/web/BookController.java @@ -422,7 +422,7 @@ public class BookController { // REDIRECTS @RequestMapping( - value = { "*", "error" } + value = { "*", "${page.url.error}" } ) @ResponseStatus(HttpStatus.FOUND) public String redirectToDefaultWebForm( diff --git a/bookstore/src/main/java/com/fjordtek/bookstore/web/BookRestController.java b/bookstore/src/main/java/com/fjordtek/bookstore/web/BookRestController.java index 4b8e4ab..e587916 100644 --- a/bookstore/src/main/java/com/fjordtek/bookstore/web/BookRestController.java +++ b/bookstore/src/main/java/com/fjordtek/bookstore/web/BookRestController.java @@ -65,7 +65,7 @@ public class BookRestController { httpServerLogger.log(requestData, responseData); - if (authorities.contains("MARKETING")) { + if (authorities.contains(env.getProperty("auth.authority.sales"))) { return bookRepository.findAll(); } else { return bookRepository.findAllPublished(); @@ -95,7 +95,7 @@ public class BookRestController { * Prevent other than MARKETING users to access hidden book * data even if they knew hash id. */ - if (!book.getPublish() && !authorities.contains("MARKETING") ) { + if (!book.getPublish() && !authorities.contains(env.getProperty("auth.authority.sales")) ) { responseData.setHeader("Location", env.getProperty("page.url.index")); responseData.setStatus(302); httpServerLogger.log(requestData, responseData);