Which Spring Security annotation is used to apply security constraints at the method level based on SpEL expressions?

  • @PreFilter
  • @PostFilter
  • @PreAuthorize
  • @PostAuthorize
The @PreAuthorize annotation is used to apply security constraints at the method level based on SpEL (Spring Expression Language) expressions. You can define complex conditions using SpEL to control method access. The other options are used for filtering, not method-level security.
Add your answer
Loading...

Leave a comment

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