Commit 60b9704f authored by Stefan H. Holek's avatar Stefan H. Holek

SecurityManager.validateValue no longer exists.

parent 3df03f2b
...@@ -116,26 +116,28 @@ class TestPythonScript(ZopeTestCase.ZopeTestCase): ...@@ -116,26 +116,28 @@ class TestPythonScript(ZopeTestCase.ZopeTestCase):
def testCannotAccessWithoutAccessPermissionSecurityManager(self): def testCannotAccessWithoutAccessPermissionSecurityManager(self):
# manage_main should be protected # manage_main should be protected
self.assertRaises(Unauthorized, getSecurityManager().validateValue, self.ps.manage_main) self.assertRaises(Unauthorized, getSecurityManager().validate,
self.ps, self.ps, 'manage_main', self.ps.manage_main)
def testCanAccessWithAccessPermissionSecurityManager(self): def testCanAccessWithAccessPermissionSecurityManager(self):
# manage_main should be accessible if we have the necessary permissions # manage_main should be accessible if we have the necessary permissions
self.setPermissions(access_permissions) self.setPermissions(access_permissions)
try: try:
getSecurityManager().validateValue(self.ps.manage_main) getSecurityManager().validate(self.ps, self.ps, 'manage_main', self.ps.manage_main)
except Unauthorized: except Unauthorized:
self.fail('Access to manage_main was denied') self.fail('Access to manage_main was denied')
def testCannotAccessIfAnonymousSecurityManager(self): def testCannotAccessIfAnonymousSecurityManager(self):
# manage_main should be protected from Anonymous # manage_main should be protected from Anonymous
self.logout() self.logout()
self.assertRaises(Unauthorized, getSecurityManager().validateValue, self.ps.manage_main) self.assertRaises(Unauthorized, getSecurityManager().validate,
self.ps, self.ps, 'manage_main', self.ps.manage_main)
def testCanAccessIfManagerSecurityManager(self): def testCanAccessIfManagerSecurityManager(self):
# manage_main should be accessible to Manager # manage_main should be accessible to Manager
self.setRoles(['Manager']) self.setRoles(['Manager'])
try: try:
getSecurityManager().validateValue(self.ps.manage_main) getSecurityManager().validate(self.ps, self.ps, 'manage_main', self.ps.manage_main)
except Unauthorized: except Unauthorized:
self.fail('Access to manage_main was denied to Manager') self.fail('Access to manage_main was denied to Manager')
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment