在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称:mikespook/gorbac开源软件地址:https://github.com/mikespook/gorbac开源编程语言:Go 97.8%开源软件介绍:goRBACgoRBAC provides a lightweight role-based access control implementation in Golang. For the purposes of this package:
Thus, RBAC has the following model:
VersionCurrently, goRBAC has two released versions Version 1 is the original design which will only be mantained to fix bugs. Version 2 is the new design which will only be mantained to fix bugs. and the developing branch is The master branch will be under development with generic (go 1.18 and higher) and can be changed without notice. InstallInstall the package:
UsageAlthough you can adjust the RBAC instance anytime and it's absolutely safe, the library is designed for use with two phases:
PreparingImport the library:
Get a new instance of RBAC:
Get some new roles:
Get some new permissions:
Add the permissions to roles:
Also, you can implement After initialization, add the roles to the RBAC instance:
And set the inheritance:
CheckingChecking the permission is easy:
And there are some built-in util-functions: InherCircle, AnyGranted, AllGranted. Please open an issue for the new built-in requirement. E.g.:
PersistenceThe most asked question is how to persist the goRBAC instance. Please check the post HOW TO PERSIST GORBAC INSTANCE for the details. Authors
Open Source - MIT Software LicenseSee LICENSE. |
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论