mirror of
https://github.com/spring-projects/spring-boot.git
synced 2026-09-24 10:19:03 +00:00
Polish
This commit is contained in:
+2
-1
@@ -41,7 +41,8 @@ public class SampleSecureApplication implements CommandLineRunner {
|
||||
.commaSeparatedStringToAuthorityList("ROLE_USER")));
|
||||
try {
|
||||
System.out.println(service.secure());
|
||||
} finally {
|
||||
}
|
||||
finally {
|
||||
SecurityContextHolder.clearContext();
|
||||
}
|
||||
}
|
||||
|
||||
+2
-2
@@ -22,11 +22,11 @@ import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* @author Dave Syer
|
||||
*
|
||||
*
|
||||
*/
|
||||
@Service
|
||||
public class SampleService {
|
||||
|
||||
|
||||
@Secured("ROLE_USER")
|
||||
public String secure() {
|
||||
return "Hello Security";
|
||||
|
||||
Reference in New Issue
Block a user