本文整理汇总了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']
示例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)
示例3: tearDown
# 需要导入模块: from AccessControl import SecurityManagement [as 别名]
# 或者: from AccessControl.SecurityManagement import noSecurityManager [as 别名]
def tearDown(self):
SecurityManagement.noSecurityManager()