[Zope-Checkins] CVS: Zope3/lib/python/Zope/App/Security/tests - RolePermissionManager.py:1.1.2.4 testAttributeRolePermissionManager.py:1.1.2.5 testRolePermissionManager.py:1.1.2.8
Steve Alexander
steve@cat-box.net
Fri, 15 Feb 2002 14:15:36 -0500
Update of /cvs-repository/Zope3/lib/python/Zope/App/Security/tests
In directory cvs.zope.org:/tmp/cvs-serv3201/lib/python/Zope/App/Security/tests
Modified Files:
Tag: Zope-3x-branch
RolePermissionManager.py testAttributeRolePermissionManager.py
testRolePermissionManager.py
Log Message:
Fixed typos in unsetPermissionForRole --> unsetPermissionFromRole, to bring in line with interface IRolePermissionManager.
Fixed Permission-Role mapping UI in line with new LocalRoles/Permissions changes.
=== Zope3/lib/python/Zope/App/Security/tests/RolePermissionManager.py 1.1.2.3 => 1.1.2.4 ===
r=[]
for role, permissions in self._rp.items():
- if permission in permissions: r.append(role)
+ if permission in permissions: r.append((role, 'Allow'))
return r
def getPermissionAcquired(self, permission):
@@ -41,13 +41,14 @@
def getPermissionsForRole(self, role):
'''See interface IRolePermissionMap'''
- return self._rp[role]
+ print "getPermissionsForRole", self._rp[role]
+ return [(perm,'Allow') for perm in self._rp[role]]
def setPermissionAcquired(self, permission, flag):
'''See interface IRolePermissionManager'''
raise TypeError
- def retractPermissionFromRole(self, permission, role):
+ def unsetPermissionFromRole(self, permission, role):
'''See interface IRolePermissionManager'''
permissions = self._rp.get(role, ())
if permission in permissions:
=== Zope3/lib/python/Zope/App/Security/tests/testAttributeRolePermissionManager.py 1.1.2.4 => 1.1.2.5 ===
self.assertEqual(l, [(self.read, Deny)] )
- mgr.unsetPermissionForRole(self.read, self.peon)
+ mgr.unsetPermissionFromRole(self.read, self.peon)
l = list(mgr.getRolesForPermission(self.read))
self.assertEqual(l, [ (self.manager, Allow) ] )
=== Zope3/lib/python/Zope/App/Security/tests/testRolePermissionManager.py 1.1.2.7 => 1.1.2.8 ===
self.failUnless((perm2,Allow) in perms)
self.failUnless((perm3,Deny) in perms)
- manager.unsetPermissionForRole(perm1, role1)
+ manager.unsetPermissionFromRole(perm1, role1)
perms = manager.getPermissionsForRole(role1)
self.assertEqual(len(perms), 2)
self.failUnless((perm2,Allow) in perms)
@@ -79,7 +79,7 @@
self.failIf((role1,Allow) in roles)
self.failUnless((role1,Deny) in roles)
self.failUnless((role2,Allow) in roles)
- manager.unsetPermissionForRole(perm1, role1)
+ manager.unsetPermissionFromRole(perm1, role1)
roles = manager.getRolesForPermission(perm1)
self.assertEqual(len(roles), 1)
self.failUnless((role2,Allow) in roles)