In Spring Security, which annotation is specifically used to enforce security constraints on methods at a fine-grained level?

  • @Permission
  • @PreAuthorize
  • @RolesAllowed
  • @Secured
The @PreAuthorize annotation is used in Spring Security to enforce security constraints on methods at a fine-grained level. You can specify a SpEL (Spring Expression Language) expression as a condition for method access. If the condition evaluates to true, access is allowed.
Add your answer
Loading...

Leave a comment

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