How can you configure a custom method security expression handler in Spring Security?
- By adding @MethodSecurityExpressionHandler annotation to a method.
- By extending the AbstractMethodSecurityExpressionHandler class.
- By implementing the MethodSecurityExpressionHandler interface and registering it in the Spring context.
- By modifying the application.properties file.
To configure a custom method security expression handler, you need to implement the MethodSecurityExpressionHandler interface, create a bean of it, and register it in the Spring context. This allows you to define custom security expressions for method-level security checks.
Loading...
Related Quiz
- Suppose you are working on a Spring Boot project and need to ensure that certain fields in the incoming request payload are consistent with each other (e.g., startDate should be before endDate). How would you implement this validation?
- You are tasked with developing a Spring Boot application using Spring Data JPA, where ensuring the consistency of the data is crucial. How would you manage the transactions in the application to ensure the integrity and consistency of the data?
- The _____ annotation is used to mark the main class of a Spring Boot application.
- You are tasked with implementing a consistent error response structure across multiple microservices developed using Spring Boot. How would you ensure that all the microservices return error responses in the same format?
- What is the significance of the @Transactional annotation in Spring Data JPA?