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.
Loading...
Related Quiz
- How can you configure a custom method security expression handler in Spring Security?
- In Spring Data JPA, the _____ is responsible for managing transaction boundaries during the execution of a method annotated with @Transactional.
- The _____ annotation in JUnit is used to indicate that a method should be executed after all tests in the current test class have been run.
- How can you perform integration testing on security configurations in a Spring Boot application to ensure security constraints are met?
- How would you optimize Request Mapping in a large Spring Boot application with numerous endpoints?