当前位置:网站首页>security权限管理详解
security权限管理详解
2022-07-26 05:01:00 【程序三两行】
一、授权流程

用户登录成功后会将用户信息保存在Authencation对象中,Authencation接口中有一个getAuthorities()方法返回的是用户的权限
Collection<? extends GrantedAuthority> getAuthorities();
现有系统可以基于角色做权限管理也可以使用资源(权限字符串)做权限管理,这里的GrantedAuthority是角色还是资源呢?
- 如果 业务是基于角色做的权限管理,即用户->角色->资源,那么返回的是用户的角色
- 如果业务是基于资源(权限)做的权限管理,即用户->权限->资源,返回的是用户的权限
- 如果基于角色+权限做的权限管理,即用户->角色->权限->资源,返回的是用户的权限
security在角色和权限的处理方式上基本一样的,唯一区别就是很多时候会自动给角色增加一个ROLE_前缀,而权限不会添加
二、权限管理策略
1、基于URL做权限管理(过滤器技术实现)
@Configuration
public class SecurityConfig extends WebSecurityConfig边栏推荐
- What is the difference between asynchronous and synchronous transmission signals (electronic hardware)
- 奥特学园ROS笔记--6
- 【ACWing】2983. 玩具
- [enterprise micro procedure]
- Textfield and password input box that are more flexible and easy to use in compose
- 批量将PPM格式图片转化为JPG格式
- 时代潮流-云原生数据库的崛起
- NFT的几种发行方式你都了解过吗?不同的发行方式有什么优缺点?
- 2022 Henan Mengxin League game (3): Henan University L - synthetic game
- Several maturity levels of using MES management system
猜你喜欢

CLM陆面过程模式

JVM第二讲:类加载机制

Can serial port can 232 can 485 serial port to CANbus bus gateway module can232/485mb converter cancom

常函数const的学习

The first open source MySQL native HTAP database in China will be released soon! Look at the three highlights first, limited to the surrounding areas, waiting for you~

Sliding window -- leetcode solution

科技论文翻译,俄语文档的语法有何特点

MySQL八股知识点:从入门到删库

阿里云工业视觉智能工程师ACP认证——备考

Kubernetes advanced training camp scheduler
随机推荐
Excel VBA:实现自动下拉填充公式至最后一行
新导则下的防洪评价报告编制方法及洪水建模
The pit of history can only be filled up as far as possible
Database startup message: ora-29702: error occurred in cluster group service
C language lseek() function: move the read and write location of the file
Customer service relationship management based on SQL net enterprise messenger enterprise communications
地球系统模式(CESM)实践技术
Leetcode - monotone stack and monotone queue
CountLaunch Demo的测试
分子骨架跃迁工具-DeLinker介绍
There was an unexpected error (type=method not allowed, status=405)
Several maturity levels of using MES management system
[mathematical modeling] basic knowledge of MATLAB
Study of const of constant function
汉字风格迁移篇---通过生成对抗网络学习一对多程式化汉字的转换和生成
Redis solves the problem of oversold inventory
2022 Henan Mengxin League game (3): Henan University a - corn cannon
What are the demand management software for small and medium-sized enterprises
【ACWing】1268. 简单题
Add and modify the verification logic, and use -validation- to complete the group verification