Restricted getting account details
This commit is contained in:
parent
743c3a9d21
commit
d0a1e253b8
@ -2,6 +2,7 @@ package ru.dragonestia.picker.controller;
|
|||||||
|
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import org.springframework.http.ResponseEntity;
|
import org.springframework.http.ResponseEntity;
|
||||||
|
import org.springframework.security.access.prepost.PreAuthorize;
|
||||||
import org.springframework.security.core.context.SecurityContextHolder;
|
import org.springframework.security.core.context.SecurityContextHolder;
|
||||||
import org.springframework.security.core.userdetails.UsernameNotFoundException;
|
import org.springframework.security.core.userdetails.UsernameNotFoundException;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
@ -22,6 +23,7 @@ public class AccountsController {
|
|||||||
return account.toResponseObject();
|
return account.toResponseObject();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@PreAuthorize("hasRole('ADMIN')")
|
||||||
@GetMapping("/{accountId}")
|
@GetMapping("/{accountId}")
|
||||||
ResponseEntity<ResponseAccount> findAccount(@PathVariable String accountId) {
|
ResponseEntity<ResponseAccount> findAccount(@PathVariable String accountId) {
|
||||||
try {
|
try {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user