acl(操作控制列表)权限处理。
django-acl的Python项目详细描述
django有一个内置的权限系统,但是所有的权限都与模型直接相关。这是为了 通过添加与模型无关的权限或操作来扩展该系统。
这也为django cms添加了一个acl方面,作为可选的
文档
添加到INSTALLED APPS
Add the module to your installed apps.
INSTALLED_APS=(...'djangoacl')
模板加载程序
Add the new authentication backend to ^{tt2}$ in settings.py
TEMPLATE_LOADERS=('skin.template.loaders.filesystem.Loader','skin.template.loaders.app_directories.Loader','django.template.loaders.filesystem.Loader','django.template.loaders.app_directories.Loader',)
运行迁移
$ python manage.py migrate djangoacl
添加动作
Go to http://yoursite/admin/djangoacl/action/add/ and add the action.
Give the action a name. This can be pretty much anything you want but recommend no spaces or special characters. Also probably best not to use anything that matches then normal permission patters such as <action>_<model> or <model>.<action>
Make sure to add any related users or groups.
请求许可
Request permission in the normal way using the ^{tt3}$ decorator. See https://docs.djangoproject.com/en/1.8/topics/auth/default/#the-permission-required-decorator