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
首先非常感谢作者的开源,该项目是一个非常好的项目,但是在jwt与casbin部分并不是很懂,不知是否可以讲解本项目在这块是怎么使用的,大致思路即可
The text was updated successfully, but these errors were encountered:
首先需要制定自己的策略配置,什么是策略配置呢?
例如:
p,common,/api/v1/menulist,GET
这就是一组用户角色映射关系
common 角色能够访问资源 /api/v1/menulist 的 GET 方式。
common
/api/v1/menulist
GET
规则:
[policy_definition] p = sub, obj, act [matchers] m = r.sub == p.sub && (keyMatch2(r.obj, p.obj) || keyMatch(r.obj, p.obj)) && (r.act == p.act || p.act == "*")
p = sub, obj, act >> p,common,/api/v1/menulist,GET
keyMatch2(r.obj, p.obj) || keyMatch(r.obj, p.obj) 资源匹配规则内置提供的有一些匹配函数,因为我们项目中使用到了path参数,所以这里做了两种匹配的或计算。
以上内容是配置文件规则的简单说明,在程序里边只不过是按照上述规则进行动态的计算罢了。
另外就是使用顺序,JWT 在前,Casbin在后,这个知道为什么吗?如果想知道请留言吧。
Sorry, something went wrong.
想知道,望解答,谢谢
No branches or pull requests
首先非常感谢作者的开源,该项目是一个非常好的项目,但是在jwt与casbin部分并不是很懂,不知是否可以讲解本项目在这块是怎么使用的,大致思路即可
The text was updated successfully, but these errors were encountered: