When using @Secured annotation, what is the format to specify the required authority?

  • @Secured("ADMIN")
  • @Secured("ROLE_ADMIN")
  • @Secured("authority.ADMIN")
  • @Secured("hasAuthority('ADMIN')")
The correct format to specify the required authority using the @Secured annotation is @Secured("ROLE_ADMIN"). The "ROLE_" prefix is typically used to specify roles. The other options are not the correct format.
Add your answer
Loading...

Leave a comment

Your email address will not be published. Required fields are marked *