Skip to content
New issue

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

请问下 flask用户权限分配 #1

Closed
vTNT opened this issue Sep 10, 2016 · 5 comments
Closed

请问下 flask用户权限分配 #1

vTNT opened this issue Sep 10, 2016 · 5 comments

Comments

@vTNT
Copy link

vTNT commented Sep 10, 2016

请问 如果要实现 类似django http://www.cnblogs.com/dreamer-fish/p/5477178.html 分组细化权限配置的 要怎么实现啊?

@flyhigher139
Copy link
Owner

@vTNT 可以用flask-principal实现权限机制,如果你想要类似django原生的权限配置页面,要自己写

也可以找找flask扩展中有没有满足你需求的轮子

@vTNT
Copy link
Author

vTNT commented Sep 11, 2016

flask-principal 从我看一些例子的理解是这样的 就是提前设置一些用户角色,比如类似su, admin, editor, writer, reader 那么比如我是想先细分每个Project的权限, 比如assets 然后分配具体的add_assets,然后通过web 创建具体的组 并且在分配具体项目的权限 这种情况下 还可以用flask-principal吗

@vTNT
Copy link
Author

vTNT commented Sep 11, 2016

https://github.com/raddevon/flask-permissions 找到这个 有点类似我那需求

@flyhigher139
Copy link
Owner

@vTNT flask-principal 用起来非常灵活,关键是要想清楚自己的权限模型,然后各种权限需求都可以用flask-principal实现,所以flask-principal能用好的话,学习曲线并不是很低,你提到的那些用法是最常用的、最典型的权限模型,所以flask-principal直接固化下来,并在文档中做了介绍

@vTNT
Copy link
Author

vTNT commented Sep 22, 2016

因为我想做个页面 来灵活管理 所以想基于数据库的方式

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants