Commit 3a7b1f58 authored by Shane Hathaway's avatar Shane Hathaway

Initialize SpecialUsers if needed. Code that imports AccessControl without

importing AccessControl.User specifically will now function correctly.
parent 4ec6f185
...@@ -13,8 +13,8 @@ ...@@ -13,8 +13,8 @@
__doc__='''short description __doc__='''short description
$Id: SecurityManagement.py,v 1.7 2002/08/14 21:29:07 mj Exp $''' $Id: SecurityManagement.py,v 1.8 2003/05/14 21:51:23 shane Exp $'''
__version__='$Revision: 1.7 $'[11:-2] __version__='$Revision: 1.8 $'[11:-2]
def getSecurityManager(): def getSecurityManager():
"""Get a security manager, for the current thread. """Get a security manager, for the current thread.
...@@ -22,9 +22,12 @@ def getSecurityManager(): ...@@ -22,9 +22,12 @@ def getSecurityManager():
thread_id=get_ident() thread_id=get_ident()
manager=_managers.get(thread_id, None) manager=_managers.get(thread_id, None)
if manager is None: if manager is None:
manager=SecurityManager( nobody = getattr(SpecialUsers, 'nobody', None)
thread_id, if nobody is None:
SecurityContext(SpecialUsers.nobody)) # Initialize SpecialUsers by importing User.py.
import User
nobody = SpecialUsers.nobody
manager = SecurityManager(thread_id, SecurityContext(nobody))
_managers[thread_id]=manager _managers[thread_id]=manager
return manager return 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