refactor(welcome): update getRoles method signature
This commit is contained in:
		
					parent
					
						
							
								993387fa0c
							
						
					
				
			
			
				commit
				
					
						9824fbbbfd
					
				
			
		
					 1 changed files with 3 additions and 3 deletions
				
			
		|  | @ -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<Collection<? extends GrantedAuthority>> getRoles(Authentication authentication) { | ||||
|         return ResponseEntity.ok(authentication.getAuthorities()); | ||||
|     } | ||||
| 
 | ||||
|  |  | |||
		Reference in a new issue