[Zope-Checkins] CVS: Zope3/lib/python/Zope/App/Security - SecurityManagement.py:

Guido van Rossum guido@python.org
Thu, 13 Dec 2001 10:11:52 -0500

Update of /cvs-repository/Zope3/lib/python/Zope/App/Security
In directory cvs.zope.org:/tmp/cvs-serv21433

Modified Files:
      Tag: Zope-3x-branch
Log Message:
getSecurityManager(): *Temporary* stopgap to make the test suite run
now that the User module class are deleted; if there's no manager,
make something up that has a getUserName() method.  This should
disappear as soon as Jim & Tres have figured out what to do instead.

=== Zope3/lib/python/Zope/App/Security/SecurityManagement.py => ===
     if manager is None:
-        import User
-        newSecurityManager( User.UserWithName( 'Anonymous User' ) )
+        class NN:
+            def getUserName(self): return 'Anonymous User'
+        newSecurityManager( NN() )
         manager=_managers.get( thread_id, None )
     return manager