Skip to content

Glossary: Spring Boot Beyond the Basics

@PreAuthorize

Also written: PreAuthorize

An annotation that checks a rule, such as `hasRole('STAFF')`, before a service method runs, so the method refuses callers who lack the role however it is reached.

Where the book teaches it

Related terms

@EnableMethodSecurityMethod security