【文件属性】:
文件名称:cancan:cancan是基于ruby cancan库的微小权限控制器
文件大小:15KB
文件格式:ZIP
更新时间:2021-02-04 20:43:47
python flask django permission DjangoPython
可以可以
介绍
cancan是一个基于ruby cancan库的微型权限控制器。 一旦定义了用户能力,就可以轻松地检查用户的权限。
安装
pip install cancan
基本用法
从cancan.Ability继承
使用add方法添加用户能力
def add ( self , action = None , subject = None , ** conditions )`
"""
Add ability are allowed using two arguments .
The first one is the action you ' re setting
【文件预览】:
cancan-master
----django_example()
--------django_example()
--------manage.py(924B)
--------blog()
----cancan()
--------tests.py(3KB)
--------ability.py(4KB)
--------__init__.py(101B)
--------rule.py(3KB)
----tox.ini(78B)
----LICENSE(1KB)
----setup.py(361B)
----README.md(4KB)
----.gitignore(70B)
----example.py(3KB)