Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

根据用户传来的请求地址,分析出请求需要的角色 #296

Open
feyounger opened this issue Dec 16, 2021 · 0 comments
Open

Comments

@feyounger
Copy link

在 CustomFilterInvocationSecurityMetadataSource 这个类中 首先通过数据库查询到菜单表,遍历菜单匹配到对应的url再去找到这个url所拥有的角色,CustomUrlDecisionManager这个类中判断当前登录的用户是否具备当前请求URL所需要的角色信息:也是通过遍历这个URL所需要的角色,里面再通过自己所拥有的角色来得出是否有权限访问。
**提出疑问:**虽然在数据库查询哪里加了缓存,但是后面的操作都需要遍历,而且都是双重价格遍历。当访问量、系统复杂度、角色增多 这里的效率是不是很低呢。
提出想法: 利用@PreAuthorize("hasAnyAuthority('')")注解是不是可以代替上面步骤呢

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant