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 testcontainers maven构建失败   java实现jacobi算法实现laplace方程   java中的多线程:如何在不等待所有线程使用ExecutorService完成任务的情况下终止所有线程的执行?   java Hello World不在Android Studio 3中工作   ubuntu Tomcat7的Java版本不正确   java Javafx内存泄漏   对于手动实现的Spring数据存储库方法,我应该使用Java8默认方法吗?   googleappengine中的java添加过滤查询   html当使用JSOUP库在Java中读取标签时,如何保留标签(如<br>、<ul>、<li>、<p>等)的含义?   编码为什么jasper生成的报告在Java中不显示西里尔语(保加利亚语)?   java有没有办法隐藏当前位置和jdk动作?   java找出编译原型文件的版本   有没有办法在运行时更改java方法的访问修饰符?   语法字符串。。。Java中的参数   java数组元素在添加其他元素时会相互覆盖   eclipse中的java GWT项目   java如何为spring rest模板请求将动态json属性名映射到jackson   java无法在Windows 10上找到特定的JDK   在xml字符串和java字符串之间提取正则表达式子字符串