[Zope3-checkins] CVS: Zope3/src/zope/app/demo/passwdauth - __init__.py:1.2 tests.py:1.3

Stephan Richter srichter at cosmos.phy.tufts.edu
Mon Mar 8 07:07:05 EST 2004


Update of /cvs-repository/Zope3/src/zope/app/demo/passwdauth
In directory cvs.zope.org:/tmp/cvs-serv13053/src/zope/app/demo/passwdauth

Modified Files:
	__init__.py tests.py 
Log Message:


Adjusted code to use the new APIs for permissions and principals. Also, use
the utility service instead of the permission registry to look up permissions.




=== Zope3/src/zope/app/demo/passwdauth/__init__.py 1.1 => 1.2 ===
--- Zope3/src/zope/app/demo/passwdauth/__init__.py:1.1	Fri Feb 27 09:50:24 2004
+++ Zope3/src/zope/app/demo/passwdauth/__init__.py	Mon Mar  8 07:05:55 2004
@@ -46,8 +46,8 @@
             if line.strip() != '':
                 user_info = line.strip().split(':', 3)
                 p = SimplePrincipal(*user_info)
-                locate(p, self, p.id)
-                p.id = p.login
+                locate(p, self, p._id)
+                p._id = p.login
                 principals.append(p)
         return principals
 
@@ -55,7 +55,7 @@
         """See IPrincipalSource."""
         earmark, source_name, id = id.split('\t')
         for p in self.readPrincipals():
-            if p.id == id:
+            if p._id == id:
                 return p
         raise NotFoundError, id
 


=== Zope3/src/zope/app/demo/passwdauth/tests.py 1.2 => 1.3 ===
--- Zope3/src/zope/app/demo/passwdauth/tests.py:1.2	Wed Mar  3 11:08:26 2004
+++ Zope3/src/zope/app/demo/passwdauth/tests.py	Mon Mar  8 07:05:55 2004
@@ -38,7 +38,7 @@
         self.assertEqual(len(self.source.getPrincipals('2')), 1)
 
     def test_authenticate(self):
-        self.assertEqual(self.source.authenticate('foo1', 'bar1').id, 'foo1')
+        self.assertEqual(self.source.authenticate('foo1', 'bar1')._id, 'foo1')
         self.assertEqual(self.source.authenticate('foo1', 'bar'), None)
         self.assertEqual(self.source.authenticate('foo', 'bar'), None)
     




More information about the Zope3-Checkins mailing list