@PreAuthorize验证的是哪里的信息
时间: 2023-10-20 12:31:56 浏览: 74
@PreAuthorize验证的是方法执行前的权限信息。具体来说,它是一个Spring Security注解,用于在方法执行之前进行权限验证。它支持使用Spring EL表达式,可以根据表达式的结果来判断是否具有权限执行该方法。这个注解只有在@EnableGlobalMethodSecurity(prePostEnabled=true)时才会生效。通过在方法上添加@PreAuthorize注解,并传入相应的权限表达式,可以实现对方法的权限控制。在Spring Boot中,通常与Spring Security、JWT和MyBatis Plus等一起使用,以实现基于注解的权限验证。<span class="em">1</span><span class="em">2</span><span class="em">3</span>
#### 引用[.reference_title]
- *1* *2* [SpringBoot - @PreAuthorize注解详解](https://blog.csdn.net/goodjava2007/article/details/126395140)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 50%"]
- *3* [SpringBoot+SpringSecurity+JWT+MybatisPlus实现基于注解的权限验证](https://download.csdn.net/download/fuu123f/12753135)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 50%"]
[ .reference_list ]
阅读全文