在view_config装饰器中有多个权限? [英] Multiple permissions in view_config decorator?

查看:75
本文介绍了在view_config装饰器中有多个权限?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在基于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装饰器中有多个权限?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆