Spring Security Method-Level Security

Review how well you know @PreAuthorize,@Secured,and role-based access.

1. Which annotation is used to perform authorization checks before a method is executed?
2. Which annotations are used for filtering collections in method-level security?
3. @PostAuthorize checks authorization conditions after the method has executed.
4. What is the full name of the annotation used to enable method-level security in Spring Security 5.6+?
5. Which SpEL expression function checks if a user has a specific role (automatically prefixes with 'ROLE_')?
6. Which of the following are valid SpEL expressions in @PreAuthorize?
7. @PreAuthorize can only be applied to public methods.
8. What SpEL function checks if a user has a specific authority without automatically adding a 'ROLE_' prefix?
9. Which are required to enable method-level security in a Spring application?
10. Name the annotation that filters the return collection of a method based on a SpEL expression.
Answered 0 of 0 — 0 correct