javaspringsecurityannotationsrole

What does @Secured({ "ROLE_USER", "ROLE_ADMIN" }) exactly means


I have come accross the following annotation in my example code.

@Secured({ "ROLE_USER", "ROLE_ADMIN" }) 

Could anyone explain what doest it mean?


Solution

  • It's a Spring Security Framework annotation to allow the method to be executed only when the caller has either ROLE_USER or ROLE_ADMIN security roles.

    See the documentation for more information on Spring Security.