What is the primary use of the @PreAuthorize annotation in Spring Security?

  • To execute a method before a security check
  • To post-authorize access to a method
  • To restrict access to a method based on a condition before it's executed
  • To specify the method's execution time
The primary use of @PreAuthorize is to restrict access to a method based on a condition before it's executed. You can define an expression in this annotation to control who can access the method.
Add your answer
Loading...

Leave a comment

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