[Zope-Checkins] CVS: Zope3/lib/python/Zope/App/Security - ISecurityManager.py:1.1.2.5 SecurityManager.py:1.1.2.6 ZopeSecurityPolicy.py:1.1.2.8
Guido van Rossum
guido@python.org
Thu, 13 Dec 2001 17:12:31 -0500
Update of /cvs-repository/Zope3/lib/python/Zope/App/Security
In directory cvs.zope.org:/tmp/cvs-serv17775
Modified Files:
Tag: Zope-3x-branch
ISecurityManager.py SecurityManager.py ZopeSecurityPolicy.py
Log Message:
Rename SecurityManager.getUser to getPrincipal.
=== Zope3/lib/python/Zope/App/Security/ISecurityManager.py 1.1.2.4 => 1.1.2.5 ===
executable context and policies.
"""
- def getUser():
+ def getPrincipal():
"""
- Return the authenticated user.
+ Return the authenticated principal.
This is equivalent to something like::
=== Zope3/lib/python/Zope/App/Security/SecurityManager.py 1.1.2.5 => 1.1.2.6 ===
# ISecurityManager implementation
#
- def getUser( self ):
+ def getPrincipal( self ):
"""
Return the authenticated user.
=== Zope3/lib/python/Zope/App/Security/ZopeSecurityPolicy.py 1.1.2.7 => 1.1.2.8 ===
, context
):
+ raise Unauthorized, "Jim & Guido were here"
if not self._allowName( name ):
raise Unauthorized, "Name '%s' is not allowed" % name
@@ -83,10 +84,10 @@
if not allowed:
raise Unauthorized, \
- ( "User '%s' does not have permission, %s"
+ ( "Principal '%s' does not have permission, %s"
"(user would need one of the following roles: %s)"
% ( permission
- , context.user.getUserName()
+ , context.user.getTitle()
, string.join( roles, ',' )
)
)