问题描述
我正在基于Pyramid框架配置Web应用程序的访问控制.我正在使用@view_config
装饰器为我的视图可调用对象设置权限.我有两个权限,即'read'
和'write'
.现在,我希望某些视图同时需要两个权限.我无法弄清楚如何使用view_config
做到这一点-我是否缺少某些东西,或者还有其他方法可以做到这一点?
I am configuring access control for a web application based on the Pyramid framework. I am setting up permissions for my view callables using the @view_config
decorator. I have two permissions, namely 'read'
and 'write'
. Now, I want certain views to require both permissions. I was unable to figure out how to do this with view_config
- am I missing something, or is there maybe another way to do this?
推荐答案
获得readwrite
权限.每个视图仅获得一个权限,但是每个主体可以映射到许多权限.
Make a readwrite
permission. Each view gets one and only one permission but each principal can be mapped to many permissions.
这篇关于在view_config装饰器中有多个权限?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!