Skip to content

Commit

Permalink
Restricted getting account details
Browse files Browse the repository at this point in the history
ScarletRedMan committed Mar 25, 2024
1 parent 743c3a9 commit d0a1e25
Showing 1 changed file with 2 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -2,6 +2,7 @@

import lombok.RequiredArgsConstructor;
import org.springframework.http.ResponseEntity;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.security.core.context.SecurityContextHolder;
import org.springframework.security.core.userdetails.UsernameNotFoundException;
import org.springframework.web.bind.annotation.*;
@@ -22,6 +23,7 @@ ResponseAccount currentAccount() {
return account.toResponseObject();
}

@PreAuthorize("hasRole('ADMIN')")
@GetMapping("/{accountId}")
ResponseEntity<ResponseAccount> findAccount(@PathVariable String accountId) {
try {

0 comments on commit d0a1e25

Please sign in to comment.