[Zope3-checkins] CVS: Zope3/src/zope/app/securitypolicy -
zopepolicy.py:1.3
Jim Fulton
jim at zope.com
Sat Mar 6 12:49:24 EST 2004
Update of /cvs-repository/Zope3/src/zope/app/securitypolicy
In directory cvs.zope.org:/tmp/cvs-serv21993/src/zope/app/securitypolicy
Modified Files:
zopepolicy.py
Log Message:
Changed most calls to queryAdapter to use interface calls instead.
=== Zope3/src/zope/app/securitypolicy/zopepolicy.py 1.2 => 1.3 ===
--- Zope3/src/zope/app/securitypolicy/zopepolicy.py:1.2 Tue Mar 2 08:42:39 2004
+++ Zope3/src/zope/app/securitypolicy/zopepolicy.py Sat Mar 6 12:48:53 2004
@@ -16,7 +16,6 @@
$Id$
"""
from zope.interface import implements
-from zope.component import queryAdapter
from zope.security.interfaces import ISecurityPolicy
from zope.security.management import system_user
@@ -148,7 +147,7 @@
for place in LocationIterator(object):
# Copy specific principal permissions
- prinper = queryAdapter(place, IPrincipalPermissionMap)
+ prinper = IPrincipalPermissionMap(place, None)
if prinper is not None:
for principal in principals:
for principal_permission, setting in (
@@ -172,7 +171,7 @@
return True
# Collect principal roles
- prinrole = queryAdapter(place, IPrincipalRoleMap)
+ prinrole = IPrincipalRoleMap(place, None)
if prinrole is not None:
for principal in principals:
roles = principals[principal]
@@ -183,7 +182,7 @@
roles[role] = setting
# Collect role permissions
- roleper = queryAdapter(place, IRolePermissionMap)
+ roleper = IRolePermissionMap(place, None)
if roleper is not None:
for perm, role, setting in roleper.getRolesAndPermissions():
assert setting in (Allow, Deny)
@@ -245,7 +244,7 @@
for place in LocationIterator(object):
# Copy specific principal permissions
- prinper = queryAdapter(place, IPrincipalPermissionMap)
+ prinper = IPrincipalPermissionMap(place, None)
if prinper is not None:
for permission, setting in prinper.getPermissionsForPrincipal(
principalid):
@@ -253,7 +252,7 @@
permissions[permission] = setting
# Collect principal roles
- prinrole = queryAdapter(place, IPrincipalRoleMap)
+ prinrole = IPrincipalRoleMap(place, None)
if prinrole is not None:
for role, setting in prinrole.getRolesForPrincipal(principalid):
if role not in roles:
@@ -269,7 +268,7 @@
for place in LocationIterator(object):
# Collect role permissions
- roleper = queryAdapter(place, IRolePermissionMap)
+ roleper = IRolePermissionMap(place, None)
if roleper is not None:
for perm, role, setting in roleper.getRolesAndPermissions():
if role in roles and perm not in permissions:
More information about the Zope3-Checkins
mailing list