Browse Source

Update controller links & authorities

Signed-off-by: Pekka Helenius <fincer89@hotmail.com>
v0.0.3-alpha
Pekka Helenius 4 years ago
parent
commit
ac02bad770
2 changed files with 3 additions and 3 deletions
  1. +1
    -1
      bookstore/src/main/java/com/fjordtek/bookstore/web/BookController.java
  2. +2
    -2
      bookstore/src/main/java/com/fjordtek/bookstore/web/BookRestController.java

+ 1
- 1
bookstore/src/main/java/com/fjordtek/bookstore/web/BookController.java View File

@ -422,7 +422,7 @@ public class BookController {
// REDIRECTS
@RequestMapping(
value = { "*", "error" }
value = { "*", "${page.url.error}" }
)
@ResponseStatus(HttpStatus.FOUND)
public String redirectToDefaultWebForm(


+ 2
- 2
bookstore/src/main/java/com/fjordtek/bookstore/web/BookRestController.java View File

@ -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);


Loading…
Cancel
Save