From 9824fbbbfd68c394ba7bea768ec8d55a9fd4dad6 Mon Sep 17 00:00:00 2001 From: Jan Klattenhoff Date: Wed, 2 Oct 2024 09:35:12 +0200 Subject: [PATCH] refactor(welcome): update getRoles method signature --- .../java/de/szut/lf8_starter/welcome/WelcomeController.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main/java/de/szut/lf8_starter/welcome/WelcomeController.java b/src/main/java/de/szut/lf8_starter/welcome/WelcomeController.java index 6ed067b..a565f3f 100644 --- a/src/main/java/de/szut/lf8_starter/welcome/WelcomeController.java +++ b/src/main/java/de/szut/lf8_starter/welcome/WelcomeController.java @@ -3,12 +3,12 @@ package de.szut.lf8_starter.welcome; import org.springframework.http.ResponseEntity; -import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.security.core.Authentication; +import org.springframework.security.core.GrantedAuthority; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RestController; -import java.security.Principal; +import java.util.Collection; @RestController public class WelcomeController { @@ -19,7 +19,7 @@ public class WelcomeController { } @GetMapping("/roles") - public ResponseEntity getRoles(Authentication authentication) { + public ResponseEntity> getRoles(Authentication authentication) { return ResponseEntity.ok(authentication.getAuthorities()); }