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
刚go 初学,看了半天,没找到。
The text was updated successfully, but these errors were encountered:
@hequan2017 , 代码里初始化Casbin Enforcer的时候,确实没有指定Adapter,也就不会加载任何策略、数据库表。他是把逻辑写在model里了:https://github.com/LyricTian/gin-admin/blob/master/config/model.conf
[request_definition] r = sub, obj, act [policy_definition] p = sub, obj, act [role_definition] g = _, _ [policy_effect] e = some(where (p.eft == allow)) [matchers] m = g(r.sub, p.sub) == true \ && keyMatch2(r.obj, p.obj) == true \ && regexMatch(r.act, p.act) == true \ || r.sub == "root" \ || keyMatch2(r.obj, "/api/v1/login") == true \ || keyMatch2(r.obj, "/api/v1/logout") == true \ || keyMatch2(r.obj, "/api/v1/current/menus") == true \ || keyMatch2(r.obj, "/api/v1/current/user") == true
所以实现了和Adapter类似的效果,不过按道理说,/api/v1/login 这些具体RESTful路径,应该是放到policy(csv文件、数据库)里的
/api/v1/login
Sorry, something went wrong.
了解了。感谢作者。 期待后续功能。
No branches or pull requests
刚go 初学,看了半天,没找到。
The text was updated successfully, but these errors were encountered: