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

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
java试图用Mockito模拟IntConsumer失败   java从ArrayList获取一个元素   是否可以调用。。xyz\jdk1。6\bin\java。从jdk1上运行的java程序执行。5\java。exe?   基于连通距离的Kmeans plus聚类算法在java中的应用   java源代码管理是否使Javadoc的@author和@since冗余?   java静态对象引用和非静态对象引用   java如何创建需要动态参数的对象   java试图将字符串添加到一个字符串列表中,但最终将字符串添加到两个字符串列表中。   javacom。凭直觉。ipp。例外Quickbooks中的异常   安全性是对JAR进行模糊处理,足以防止普通最终用户而不是专家黑客理解JAVA代码吗?   scala S3 java API未正确列出文件夹。   java会话超时后重定向到前一个用户上次访问的页面   java Android到excel。jExecl制作0b文件   从jtextfield java GUI向mysql表中插入值   java JMockit和Fest UI测试   单击swing中的add按钮时,java jtextfield从B3001开始递增1