[Zope-Checkins]
SVN: Zope/branches/lra-userid_username_separation-branch/lib/python/AccessControl/
fix RoleManager._acl_users_generator() to return correctly
wrapped user folders and test it.
Leonardo Rochael Almeida
leo at hiper.com.br
Thu Aug 25 19:02:22 EDT 2005
Log message for revision 38094:
fix RoleManager._acl_users_generator() to return correctly wrapped user folders and test it.
fix test_get_local_roles_for_userid()
Changed:
U Zope/branches/lra-userid_username_separation-branch/lib/python/AccessControl/Role.py
U Zope/branches/lra-userid_username_separation-branch/lib/python/AccessControl/tests/testIdNameSeparation.py
-=-
Modified: Zope/branches/lra-userid_username_separation-branch/lib/python/AccessControl/Role.py
===================================================================
--- Zope/branches/lra-userid_username_separation-branch/lib/python/AccessControl/Role.py 2005-08-25 23:02:14 UTC (rev 38093)
+++ Zope/branches/lra-userid_username_separation-branch/lib/python/AccessControl/Role.py 2005-08-25 23:02:21 UTC (rev 38094)
@@ -354,7 +354,7 @@
while item is not _notfound:
aclu = getattr(aq_base(item), '__allow_groups__', _notfound)
if aclu is not _notfound:
- yield aclu
+ yield item.__allow_groups__
item = getattr(item, 'aq_parent', _notfound)
def get_valid_userids(self):
Modified: Zope/branches/lra-userid_username_separation-branch/lib/python/AccessControl/tests/testIdNameSeparation.py
===================================================================
--- Zope/branches/lra-userid_username_separation-branch/lib/python/AccessControl/tests/testIdNameSeparation.py 2005-08-25 23:02:14 UTC (rev 38093)
+++ Zope/branches/lra-userid_username_separation-branch/lib/python/AccessControl/tests/testIdNameSeparation.py 2005-08-25 23:02:21 UTC (rev 38094)
@@ -246,8 +246,8 @@
self.assertEquals(self.app.get_local_roles_for_userid('user1'),
('Owner',))
self.uf.renameUser('user1', 'user2')
- self.assertRaises(ValueError,
- self.app.get_local_roles_for_userid, 'user1')
+ self.assertEquals(self.app.get_local_roles_for_userid('user1'),
+ ())
self.assertEquals(self.app.get_local_roles_for_userid('user2'),
('Owner',))
@@ -309,6 +309,14 @@
self.failIf(security.checkPermission('Add Folders', self.app),
'allowed user with old name')
+ def test_acl_users_generator(self):
+ self.app.manage_addFolder('aFolder')
+ self.app.aFolder.manage_addUserFolder()
+ ufpaths = ['/'.join(uf.getPhysicalPath())
+ for uf in self.app.aFolder._acl_users_generator()]
+ self.assertEquals(ufpaths, ['/aFolder/acl_users',
+ '/acl_users'])
+
class OwnershipTests(BaseTestCase):
def setUp(self):
More information about the Zope-Checkins
mailing list