Commit 39bb110d authored by Shane Hathaway's avatar Shane Hathaway

Corrected the text of certain kinds of 'unauthorized' error messages.

parent b1c0809b
...@@ -85,8 +85,8 @@ ...@@ -85,8 +85,8 @@
__doc__='''Define Zope\'s default security policy __doc__='''Define Zope\'s default security policy
$Id: ZopeSecurityPolicy.py,v 1.5 2000/06/01 13:46:15 jim Exp $''' $Id: ZopeSecurityPolicy.py,v 1.6 2000/06/29 14:08:07 shane Exp $'''
__version__='$Revision: 1.5 $'[11:-2] __version__='$Revision: 1.6 $'[11:-2]
import SimpleObjectPolicies import SimpleObjectPolicies
_noroles=[] _noroles=[]
...@@ -115,6 +115,7 @@ class ZopeSecurityPolicy: ...@@ -115,6 +115,7 @@ class ZopeSecurityPolicy:
############################################################ ############################################################
# Try to get roles # Try to get roles
roles=getattr(value, '__roles__', _noroles) roles=getattr(value, '__roles__', _noroles)
if roles is _noroles: if roles is _noroles:
############################################################ ############################################################
...@@ -184,7 +185,7 @@ class ZopeSecurityPolicy: ...@@ -184,7 +185,7 @@ class ZopeSecurityPolicy:
% cleanupName(name, value)) % cleanupName(name, value))
return 0 return 0
# Proxy roles, which are alot safer now. # Proxy roles, which are a lot safer now.
proxy_roles=getattr(eo, '_proxy_roles', None) proxy_roles=getattr(eo, '_proxy_roles', None)
if proxy_roles: if proxy_roles:
for r in proxy_roles: for r in proxy_roles:
...@@ -221,6 +222,11 @@ def cleanupName(name, value): ...@@ -221,6 +222,11 @@ def cleanupName(name, value):
# If name is not available, tries to get it from the value. # If name is not available, tries to get it from the value.
_name = name _name = name
if _name is None and value is not None: if _name is None and value is not None:
try: _name = value.__name__ try: _name = value.id
except: pass except:
try: _name = value.__name__
except: pass
if callable(_name):
try: _name = _name()
except: pass
return _name return _name
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