当前位置:网站首页>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边栏推荐
- 嵌入式实操----基于RT1170 FreeRTOS实现CPU使用率统计(二十四)
- Redis solves the problem of oversold inventory
- vector详解和迭代器失效问题
- 遥感、GIS和GPS技术在水文、气象、灾害、生态、环境及卫生等领域中的应用
- Tonight! Stonedb is officially open source. Please check this strategy~
- 2022 Henan Mengxin League game (3): Henan University a - corn cannon
- 面试之请详细说下synchronized的实现原理以及相关的锁
- Kubernetes advanced training camp scheduler
- 【洛谷】P1383 高级打字机
- 图像非局部均值滤波的原理
猜你喜欢

面试之请详细说下synchronized的实现原理以及相关的锁
![[weekly translation go] how to write your first program with go](/img/77/cf77a46340a39797382fd7b60517d5.png)
[weekly translation go] how to write your first program with go

Learn to map with nature medicine -- complex heat map

The integrated real-time HTAP database stonedb, how to replace MySQL and achieve nearly 100 times the improvement of analysis performance

columns in GROUP BY clause; this is incompatible with sql_mode=only_full_group_by mysql8.0解决办法

An SQL server queries the latest records as of a certain date

To study the trend of open source and gain insight into the future of the industry, stonedb community and the China Academy of communications and communications released the Research Report on the dev

Embedded practice -- CPU utilization statistics based on rt1170 FreeRTOS (24)

Redis过期删除策略和内存淘汰策略

Recursive implementation of exponential enumeration
随机推荐
补位,稍后补上
Have you known several distribution methods of NFT? What are the advantages and disadvantages of different distribution methods?
The pit of history can only be filled up as far as possible
2022 Henan Mengxin League game (3): Henan University J - magic number
基于遥感解译与GIS技术环境影响评价图件制作
嵌入式实操----基于RT1170 FreeRTOS实现CPU使用率统计(二十四)
Mysql主从同步及主从同步延迟解决方案
公交站间的距离 : 简单模拟题
SQL加解密注入详解
A material of machine learning
Recursive implementation of exponential enumeration
2022 a.static query on tree (tree section)
How to connect tdengine through idea database management tool?
Kubernetes 进阶训练营 调度器
Study of const of constant function
The landing of tdengine in the GPS and AIS scheduling of Zhongtian steel
Ggjj, do you have a look at this problem? Does caching cause cross domain problems?
【Leetcode】493. Reverse Pairs
SQL encryption and decryption injection details
AQS唤醒线程的时候为什么从后向前遍历,我懂了