Comments (6)
@DBSN 很多朋友都问过这个问题,不过目前GF
框架暂时没有权限管理模块,可以考虑第三方比较成熟的casbin
包。未来GF
会有权限管理模块,可能是轻量级的RBAC
方式,也可能会基于casbin
。
from gf.
收到,多谢作者回复。
from gf.
你好,Casbin目前对大多数Web框架都有插件来支持集成,gf框架的,应该也需要写一个gf-authz
插件。但是看了下官方文档,好像没有找到插件开发相关的内容,请问如何开发一个gf的过滤器插件呢?
from gf.
@hsluoyz 你好,官方文档的确没有权限这块的说明。自行实现权限校验可以通过HOOK
回调注册一个全局的HOOK_BEFORE_SERVE
回调钩子来实现,如/*
, /api/*
等等全局的路由。在回调函数中调用相应的校验模块来完成权限校验,如果权限校验失败,调用r.ExitAll()
退出后续的业务逻辑执行即可。
from gf.
@hsluoyz 你好,关于gf
的权限管理插件可以参考gf-jwt
这个插件来编写:https://github.com/gogf/gf-jwt 不知道你是否有时间为gf
贡献一款基于casbin
的权限管理插件?
from gf.
可以参考下这个 https://github.com/vance-liu/gdb-adapter
from gf.
Related Issues (20)
- improve the code of formatDoInsertOption in gdb
- gproc.signal enhance
- Include .git in gf init
- When I use the gf gen service command, the logic.go I get is the folder
- WherePri possible error HOT 2
- panic: interface conversion: interface {} is *gredis.Subscription, not *gredis.Message
- Is it i18n support fallback fucntion? HOT 2
- cannot find database driver for specified database type "sqlite", did you misspell type name "sqlite" or forget importing the database driver? HOT 3
- method "Page(page,limit)" generate paging sql is incorrect where database type is not mysql
- Emergency help, the project code will be cleared after executing gf gen dao.
- Emergency help, the project code will be cleared after executing gf gen dao HOT 11
- <a href="//evil.com" rel="nofollow">click me!</a>
- why each dao query database need show tables && show full columns
- ci Occasional failure record HOT 1
- ci of UDP occasional failure record
- `gf init` won't use the latest goframe version HOT 2
- /debug/admin/shutdown is not graceful shutdown
- built-in bank-card number valid rule HOT 1
- ghttp.HookAfterOutput will cause panic
- gvar empty error
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from gf.