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
发现文档中的3, 并不准确
If even one (1) Allow mapping exists, then only roles on that list will be allowed through.
permission := roles.Allow(roles.Read, "admin") // permission := roles.Allow(roles.Read, "admin").Deny(roles.Read, "operator") fmt.Println(permission.HasPermission(roles.Read, "operator")) // only admin can see products management menu and crud on products Admin.AddMenu(&admin.Menu{Name: "Product Management", Priority: 1, Permission: permission}) product := Admin.AddResource(&products.Product{}, &admin.Config{Menu: []string{"Product Management"}, Permission: permission})
fmt 输出的是false 但是用operator角色的账号登录能看到Product Management这个菜单 所有角色都通过roles.Register 注册过
roles.Register
建议permission判断这一块使用casbin来判断
The text was updated successfully, but these errors were encountered:
No branches or pull requests
发现文档中的3, 并不准确
fmt 输出的是false
但是用operator角色的账号登录能看到Product Management这个菜单
所有角色都通过
roles.Register
注册过建议permission判断这一块使用casbin来判断
The text was updated successfully, but these errors were encountered: