文章分类 -  SpringSecurity

摘要:使用授权时可以使用注解进行权限控制,比较常用的有hasRole,hasAnyRole, hasAuthority 。 通过添加角色授权码: List<SysRole> sysRoleList = sysRoleService.listByUserId(userInfo.getId()); List< 阅读全文
posted @ 2022-09-16 16:33 门罗的魔术师 阅读(1973) 评论(0) 推荐(0) 编辑
摘要:注解式方法级安全开启 在WebSecuirtyConfig添加配置: @Configuration @EnableWebSecurity //启用Spring Security. ​ 会拦截注解了@PreAuthrize注解的配置. @EnableGlobalMethodSecurity(prePo 阅读全文
posted @ 2022-09-02 17:20 门罗的魔术师 阅读(1136) 评论(0) 推荐(0) 编辑
摘要:认证、授权是实战项目中必不可少的部分,而Spring Security则将作为首选安全组件,因此陈某新开了 《Spring Security 进阶》 这个专栏,写一写从单体架构到OAuth2分布式架构的认证授权。 Spring security这里就不再过多介绍了,相信大家都用过,也都恐惧过,相比S 阅读全文
posted @ 2022-08-21 13:58 门罗的魔术师 阅读(2328) 评论(1) 推荐(0) 编辑

点击右上角即可分享
微信分享提示