当前位置: 首页>>代码示例>>Python>>正文


Python SecurityManagement.noSecurityManager方法代码示例

本文整理汇总了Python中AccessControl.SecurityManagement.noSecurityManager方法的典型用法代码示例。如果您正苦于以下问题:Python SecurityManagement.noSecurityManager方法的具体用法?Python SecurityManagement.noSecurityManager怎么用?Python SecurityManagement.noSecurityManager使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在AccessControl.SecurityManagement的用法示例。


在下文中一共展示了SecurityManagement.noSecurityManager方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: tearDown

# 需要导入模块: from AccessControl import SecurityManagement [as 别名]
# 或者: from AccessControl.SecurityManagement import noSecurityManager [as 别名]
    def tearDown(self):
        IStatusMessage(self.request).show()
        if 'HTTP_REFERER' in self.request.environ:
            del self.request.environ['HTTP_REFERER']
        SecurityManagement.noSecurityManager()

        if 'location' in self.request.response.headers:
            del self.request.response.headers['location']
开发者ID:4teamwork,项目名称:ftw.bridge.client,代码行数:10,代码来源:test_favorite.py

示例2: test_add_portlet_fails_with_anonymous

# 需要导入模块: from AccessControl import SecurityManagement [as 别名]
# 或者: from AccessControl.SecurityManagement import noSecurityManager [as 别名]
    def test_add_portlet_fails_with_anonymous(self):
        portal = self.layer['portal']
        request = self.layer['request']

        request.environ['HTTP_X_BRIDGE_ORIGIN'] = 'client-one'
        request.form['path'] = '@@watcher-feed?uid=567891234'

        sm = SecurityManagement.getSecurityManager()
        SecurityManagement.noSecurityManager()

        try:
            view = queryMultiAdapter((portal, request),
                                     name='add-watcher-portlet')
            with self.assertRaises(Exception) as cm:
                view()
            self.assertEqual(str(cm.exception), 'Could not find userid.')

        finally:
            SecurityManagement.setSecurityManager(sm)
开发者ID:4teamwork,项目名称:ftw.bridge.client,代码行数:21,代码来源:test_add_watcher_view.py

示例3: tearDown

# 需要导入模块: from AccessControl import SecurityManagement [as 别名]
# 或者: from AccessControl.SecurityManagement import noSecurityManager [as 别名]
 def tearDown(self):
     SecurityManagement.noSecurityManager()
开发者ID:4teamwork,项目名称:ftw.bridge.client,代码行数:4,代码来源:test_request.py


注:本文中的AccessControl.SecurityManagement.noSecurityManager方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。