This commit is contained in:
Katerina881 2023-05-15 15:47:28 +04:00
parent 9f428fa251
commit 1f4e80cc2b
5 changed files with 4 additions and 3 deletions

Binary file not shown.

View File

@ -3,6 +3,7 @@ package com.LabWork.app.MangaStore.configuration;
import org.springframework.context.annotation.Configuration;
import org.springframework.http.HttpStatus;
import org.springframework.web.servlet.config.annotation.*;
import org.springframework.web.servlet.config.annotation.ViewControllerRegistry;
@Configuration
public class WebConfiguration implements WebMvcConfigurer {

View File

@ -23,8 +23,8 @@ public class UserMvcController {
this.userService = userService;
}
@GetMapping
@Secured({UserRole.AsString.ADMIN})
@GetMapping
public String getUsers(@RequestParam(defaultValue = "1") int page,
@RequestParam(defaultValue = "5") int size,
Model model) {

View File

@ -13,7 +13,7 @@ import org.springframework.web.bind.annotation.ExceptionHandler;
import java.util.stream.Collectors;
@ControllerAdvice
/*@ControllerAdvice*/
public class AdviceController {
@ExceptionHandler({
CreatorNotFoundException.class,

View File

@ -34,7 +34,7 @@
<!--(login=${#authentication.name})-->
<a class="nav-link" sec:authorize="hasRole('ROLE_ADMIN')" th:href="@{/creatorAction(login=${#authentication.name})}">CreatorAction</a>
<a class="nav-link" sec:authorize="hasRole('ROLE_USER')" th:href="@{/readerAction(readerLogin=${#authentication.name})}">ReaderAction</a>
<a sec:authorize="hasRole('ROLE_ADMIN')" class="nav-link" href="/users">Users</a>
<a sec:authorize="hasRole('ROLE_USER')" class="nav-link" href="/users">Users</a>
<a class="nav-link" href="/manga">Catalog</a>
<a class="nav-link" href="/swagger-ui/index.html">Документация REST API</a>
<a class="nav-link" href="/h2-console/">Консоль H2</a>