Polish
This commit is contained in:
@@ -41,7 +41,8 @@ public class SampleSecureApplication implements CommandLineRunner {
|
||||
.commaSeparatedStringToAuthorityList("ROLE_USER")));
|
||||
try {
|
||||
System.out.println(service.secure());
|
||||
} finally {
|
||||
}
|
||||
finally {
|
||||
SecurityContextHolder.clearContext();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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