[Zope3-checkins] CVS: Zope3/src/zope/app/securitypolicy/browser -
principalpermissionview.py:1.3 principalroleview.py:1.3
rolepermissionview.py:1.3
Jim Fulton
jim at zope.com
Sat Mar 6 11:51:00 EST 2004
Update of /cvs-repository/Zope3/src/zope/app/securitypolicy/browser
In directory cvs.zope.org:/tmp/cvs-serv11249/src/zope/app/securitypolicy/browser
Modified Files:
principalpermissionview.py principalroleview.py
rolepermissionview.py
Log Message:
Converted most getAdapter calls to use interface calls instead.
=== Zope3/src/zope/app/securitypolicy/browser/principalpermissionview.py 1.2 => 1.3 ===
--- Zope3/src/zope/app/securitypolicy/browser/principalpermissionview.py:1.2 Fri Mar 5 13:39:07 2004
+++ Zope3/src/zope/app/securitypolicy/browser/principalpermissionview.py Sat Mar 6 11:50:29 2004
@@ -44,7 +44,7 @@
"""Form action unsetting a principals permissions"""
permission_service = self.get_permission_service()
principal = self.get_principal(principal_id)
- ppm = zapi.getAdapter(self.context, IPrincipalPermissionManager)
+ ppm = IPrincipalPermissionManager(self.context)
for perm_id in permission_ids:
permission = permission_service.getPermission(perm_id)
@@ -58,7 +58,7 @@
"""Form action granting a list of permissions to a principal"""
permission_service = self.get_permission_service()
principal = self.get_principal(principal_id)
- ppm = zapi.getAdapter(self.context, IPrincipalPermissionManager)
+ ppm = IPrincipalPermissionManager(self.context)
for perm_id in permission_ids:
permission = permission_service.getPermission(perm_id)
@@ -71,7 +71,7 @@
"""Form action denying a list of permissions for a principal"""
permission_service = self.get_permission_service()
principal = self.get_principal(principal_id)
- ppm = zapi.getAdapter(self.context, IPrincipalPermissionManager)
+ ppm = IPrincipalPermissionManager(self.context)
for perm_id in permission_ids:
permission = permission_service.getPermission(perm_id)
@@ -84,7 +84,7 @@
def getUnsetPermissionsForPrincipal(self, principal_id):
"""Returns all unset permissions for this principal"""
- ppmap = zapi.getAdapter(self.context, IPrincipalPermissionMap)
+ ppmap = IPrincipalPermissionMap(self.context)
principal = self.get_principal(principal_id)
perm_serv = zapi.getService(self.context, Permissions)
result = []
@@ -101,7 +101,7 @@
Return empty list if there are no permissions.
"""
- ppmap = zapi.getAdapter(self.context, IPrincipalPermissionMap)
+ ppmap = IPrincipalPermissionMap(self.context)
principal = self.get_principal(principal_id)
permission_settings = ppmap.getPermissionsForPrincipal(principal)
=== Zope3/src/zope/app/securitypolicy/browser/principalroleview.py 1.2 => 1.3 ===
--- Zope3/src/zope/app/securitypolicy/browser/principalroleview.py:1.2 Fri Mar 5 13:39:07 2004
+++ Zope3/src/zope/app/securitypolicy/browser/principalroleview.py Sat Mar 6 11:50:29 2004
@@ -73,7 +73,7 @@
if 'APPLY' in self.request:
principals = self.request.get('principals')
roles = self.request.get('roles')
- prm = zapi.getAdapter(self.context, IPrincipalRoleManager)
+ prm = IPrincipalRoleManager(self.context)
for role in roles:
for principal in principals:
name = 'grid.%s.%s' % (role, principal)
@@ -101,7 +101,7 @@
self._roles = roles
self._grid = {}
- map = zapi.getAdapter(context, IPrincipalRoleMap)
+ map = IPrincipalRoleMap(context)
for role in roles:
rid = role.id
=== Zope3/src/zope/app/securitypolicy/browser/rolepermissionview.py 1.2 => 1.3 ===
--- Zope3/src/zope/app/securitypolicy/browser/rolepermissionview.py:1.2 Fri Mar 5 13:39:07 2004
+++ Zope3/src/zope/app/securitypolicy/browser/rolepermissionview.py Sat Mar 6 11:50:29 2004
@@ -84,7 +84,7 @@
if 'SUBMIT' in self.request:
roles = [r.id for r in self.roles()]
permissions = [p.getId() for p in self.permissions()]
- prm = zapi.getAdapter(self.context, IRolePermissionManager)
+ prm = IRolePermissionManager(self.context)
for ip in range(len(permissions)):
rperm = self.request.get("p%s" % ip)
if rperm not in permissions: continue
@@ -104,7 +104,7 @@
changed = True
if 'SUBMIT_PERMS' in self.request:
- prm = zapi.getAdapter(self.context, IRolePermissionManager)
+ prm = IRolePermissionManager(self.context)
roles = self.roles()
rperm = self.request.get('permission_id')
settings = self.request.get('settings', ())
@@ -123,7 +123,7 @@
if 'SUBMIT_ROLE' in self.request:
role_id = self.request.get('role_id')
- prm = zapi.getAdapter(self.context, IRolePermissionManager)
+ prm = IRolePermissionManager(self.context)
allowed = self.request.get(Allow.getName(), ())
denied = self.request.get(Deny.getName(), ())
for permission in self.permissions():
More information about the Zope3-Checkins
mailing list