We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
您好,权限体系这块我看了您的实现方式,先获取用户role拥有的menu,再把menu的code放进去: GrantedAuthority authority = new SimpleGrantedAuthority(menu.getCode()); grantedAuthorities.add(authority); 再跟requestURL对比,去判断是否有权限 antPathMatcher.match(authority.getAuthority(),requestUrl) 这个对比方式我不太理解工作的原理,是要求把menu和接口的地址写成一样的吗?
The text was updated successfully, but these errors were encountered:
@Terrency 是的,这样可以细粒度的控制每个用户能够访问的接口,而不是单纯菜单显示与否的问题。
Sorry, something went wrong.
谢谢回复。 明白了,我描述一下我理解的结果,您帮我看下是不是跟您的想法有出入,微服务的权限控制应该包括两种实现方式: 第一种是gateway上筛选控制每个业务微服务的的权限,在业务微服务中不做权限限制,通讯仅仅是gateway和oauth通讯,(或者是oauth直接集成到gateway中)这样带来的问题是oauth获取的用户鉴权列表需要跟业务微服务同步,微服务之间的调用越权应该无法控制; 第二种是gateway中做授权控制,在单独的微服务中做鉴权控制,每个微服务作为client端登录到oauth实现单点登录,可以在接口、服务上对用户请求的接口数据做鉴权操作,从配置上应该比第一种颗粒度细致,带来的问题我暂时还没想到。 不知道我的描述是不是清晰,期待您的答复
@Terrency 是这样的!目前采用的是你的第一种表述,第二种稍微改造一下也就能够实现
No branches or pull requests
您好,权限体系这块我看了您的实现方式,先获取用户role拥有的menu,再把menu的code放进去:
GrantedAuthority authority = new SimpleGrantedAuthority(menu.getCode());
grantedAuthorities.add(authority);
再跟requestURL对比,去判断是否有权限
antPathMatcher.match(authority.getAuthority(),requestUrl)
这个对比方式我不太理解工作的原理,是要求把menu和接口的地址写成一样的吗?
The text was updated successfully, but these errors were encountered: