To authorize access to method-level security in Spring Security, the _______ annotation can be used.
- @Authorize
- @PreAuthorize
- @Secure
- @Security
To authorize access to method-level security in Spring Security, the @PreAuthorize annotation can be used. This annotation allows you to specify expressions for controlling access to methods based on user roles or custom conditions. It's a powerful tool for fine-grained authorization control.
Loading...
Related Quiz
- In Spring Cloud, the _____ is used for defining service instance metadata and implementing custom service instance selection policies.
- Your Spring Boot application requires custom handling of specific exceptions, with different response bodies for each exception type. How would you implement this while ensuring that unhandled exceptions are also adequately addressed?
- For integration testing in Spring Boot, the _____ annotation is used to specify that only certain parts or layers of the application should be loaded.
- In a microservices architecture using Spring Boot, how would you implement a shared cache to ensure that different services have access to the same cached data, maintaining consistency?
- For creating custom auto-configuration in Spring Boot, the configuration class needs to be listed in the _____ file.