Commit 26af3f79 authored by 's avatar

Merged 'hasRole' -> 'allowed' fixup from branch

parent 7b3f18f6
...@@ -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.6 2000/06/29 14:08:07 shane Exp $''' $Id: ZopeSecurityPolicy.py,v 1.7 2000/07/05 13:51:21 brian Exp $'''
__version__='$Revision: 1.6 $'[11:-2] __version__='$Revision: 1.7 $'[11:-2]
import SimpleObjectPolicies import SimpleObjectPolicies
_noroles=[] _noroles=[]
...@@ -163,7 +163,7 @@ class ZopeSecurityPolicy: ...@@ -163,7 +163,7 @@ class ZopeSecurityPolicy:
if roles is _noroles: return 1 if roles is _noroles: return 1
# We are going to need a security-aware object to pass # We are going to need a security-aware object to pass
# to hasRole. We'll use the container. # to allowed(). We'll use the container.
value=container value=container
# Short-circuit tests if we can: # Short-circuit tests if we can:
...@@ -176,7 +176,7 @@ class ZopeSecurityPolicy: ...@@ -176,7 +176,7 @@ class ZopeSecurityPolicy:
# If the executable had an owner, can it execute? # If the executable had an owner, can it execute?
owner=eo.getOwner() owner=eo.getOwner()
if (owner is not None) and not owner.hasRole(value, roles): if (owner is not None) and not owner.allowed(value, roles):
# We don't want someone to acquire if they can't # We don't want someone to acquire if they can't
# get an unacquired! # get an unacquired!
if accessedbase is containerbase: if accessedbase is containerbase:
...@@ -201,7 +201,7 @@ class ZopeSecurityPolicy: ...@@ -201,7 +201,7 @@ class ZopeSecurityPolicy:
try: try:
if context.user.hasRole(value, roles): return 1 if context.user.allowed(value, roles): return 1
except AttributeError: pass except AttributeError: pass
# We don't want someone to acquire if they can't get an unacquired! # We don't want someone to acquire if they can't get an unacquired!
......
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