[Zope3-checkins] CVS: Zope3/src/zope/app/security/grants - permissionroles.py:1.3.10.1 principalpermission.py:1.1.26.1 principalrole.py:1.1.26.1 rolepermission.py:1.1.26.1 securitymap.py:1.1.26.1
Grégoire Weber
zope@i-con.ch
Sun, 22 Jun 2003 10:24:27 -0400
Update of /cvs-repository/Zope3/src/zope/app/security/grants
In directory cvs.zope.org:/tmp/cvs-serv24874/src/zope/app/security/grants
Modified Files:
Tag: cw-mail-branch
permissionroles.py principalpermission.py principalrole.py
rolepermission.py securitymap.py
Log Message:
Synced up with HEAD
=== Zope3/src/zope/app/security/grants/permissionroles.py 1.3 => 1.3.10.1 ===
--- Zope3/src/zope/app/security/grants/permissionroles.py:1.3 Thu May 1 15:35:32 2003
+++ Zope3/src/zope/app/security/grants/permissionroles.py Sun Jun 22 10:23:24 2003
@@ -20,10 +20,11 @@
from zope.app.interfaces.security import IRolePermissionManager
from zope.app.interfaces.security import IPermission
from zope.app.security.settings import Unset
+from zope.interface import implements
class PermissionRoles:
- __implements__ = IPermission
+ implements(IPermission)
def __init__(self, permission, context, roles):
self._permission = permission
=== Zope3/src/zope/app/security/grants/principalpermission.py 1.1 => 1.1.26.1 ===
--- Zope3/src/zope/app/security/grants/principalpermission.py:1.1 Thu Dec 26 13:49:07 2002
+++ Zope3/src/zope/app/security/grants/principalpermission.py Sun Jun 22 10:23:24 2003
@@ -15,6 +15,7 @@
from zope.component import getAdapter
+from zope.interface import implements
from zope.app.interfaces.annotation import IAnnotations
from zope.app.interfaces.security import IPrincipalPermissionManager
@@ -29,7 +30,7 @@
class AnnotationPrincipalPermissionManager:
"""Mappings between principals and permissions."""
- __implements__ = IPrincipalPermissionManager
+ implements(IPrincipalPermissionManager)
def __init__(self, context):
self._context = context
@@ -90,7 +91,7 @@
# need to remove security proxies here, otherwise we enter
# an infinite loop, becuase checking security depends on
# getting PrincipalPermissions.
- from zope.proxy.introspection import removeAllProxies
+ from zope.proxy import removeAllProxies
context = removeAllProxies(self._context)
annotations = getAdapter(context, IAnnotations)
try:
@@ -105,7 +106,7 @@
class PrincipalPermissionManager(SecurityMap):
"""Mappings between principals and permissions."""
- __implements__ = IPrincipalPermissionManager
+ implements(IPrincipalPermissionManager)
def grantPermissionToPrincipal(self, permission_id, principal_id,
check=True):
@@ -114,7 +115,7 @@
if check:
checkPermission(None, permission_id)
checkPrincipal(None, principal_id)
-
+
self.addCell(permission_id, principal_id, Allow)
def denyPermissionToPrincipal(self, permission_id, principal_id,
=== Zope3/src/zope/app/security/grants/principalrole.py 1.1 => 1.1.26.1 ===
--- Zope3/src/zope/app/security/grants/principalrole.py:1.1 Thu Dec 26 13:49:07 2002
+++ Zope3/src/zope/app/security/grants/principalrole.py Sun Jun 22 10:23:24 2003
@@ -14,6 +14,7 @@
"""Mappings between principals and roles, stored in an object locally."""
from zope.component import getAdapter
+from zope.interface import implements
from zope.app.interfaces.annotation import IAnnotations
from zope.app.interfaces.security import IPrincipalRoleManager
@@ -31,7 +32,7 @@
class AnnotationPrincipalRoleManager:
"""Mappings between principals and roles."""
- __implements__ = IPrincipalRoleManager
+ implements(IPrincipalRoleManager)
def __init__(self, context):
self._context = context
@@ -99,7 +100,7 @@
class PrincipalRoleManager(SecurityMap):
"""Mappings between principals and roles."""
- __implements__ = (IPrincipalRoleManager, IPrincipalRoleMap)
+ implements(IPrincipalRoleManager, IPrincipalRoleMap)
def assignRoleToPrincipal(self, role_id, principal_id, check=True):
''' See the interface IPrincipalRoleManager '''
=== Zope3/src/zope/app/security/grants/rolepermission.py 1.1 => 1.1.26.1 ===
--- Zope3/src/zope/app/security/grants/rolepermission.py:1.1 Thu Dec 26 13:49:07 2002
+++ Zope3/src/zope/app/security/grants/rolepermission.py Sun Jun 22 10:23:24 2003
@@ -16,6 +16,7 @@
$Id$
"""
from zope.component import getAdapter
+from zope.interface import implements
from zope.app.interfaces.annotation import IAnnotations
from zope.app.interfaces.security import IRolePermissionMap
@@ -35,7 +36,7 @@
provide adapter that manages role permission data in an object attribute
"""
- __implements__ = IRolePermissionManager, IRolePermissionMap
+ implements(IRolePermissionManager, IRolePermissionMap)
def __init__(self, context):
self._context = context
@@ -104,7 +105,7 @@
# need to remove security proxies here, otherwise we enter
# an infinite loop, becuase checking security depends on
# getting RolePermissions.
- from zope.proxy.introspection import removeAllProxies
+ from zope.proxy import removeAllProxies
context = removeAllProxies(self._context)
annotations = getAdapter(context, IAnnotations)
try:
@@ -117,7 +118,7 @@
class RolePermissions:
- __implements__ = IRole
+ implements(IRole)
def __init__(self, role, context, permissions):
self._role = role
@@ -149,7 +150,7 @@
class RolePermissionManager(SecurityMap):
"""Mappings between roles and permissions."""
- __implements__ = IRolePermissionManager
+ implements(IRolePermissionManager)
def grantPermissionToRole(self, permission_id, role_id, check=True):
'''See interface IRolePermissionMap'''
=== Zope3/src/zope/app/security/grants/securitymap.py 1.1 => 1.1.26.1 ===
--- Zope3/src/zope/app/security/grants/securitymap.py:1.1 Thu Dec 26 13:49:07 2002
+++ Zope3/src/zope/app/security/grants/securitymap.py Sun Jun 22 10:23:24 2003
@@ -15,11 +15,12 @@
from persistence import Persistent
from persistence.dict import PersistentDict
+from zope.interface import implements
from zope.app.interfaces.security.grants.securitymap import ISecurityMap
class SecurityMap(object):
- __implements__ = ISecurityMap
+ implements(ISecurityMap)
def __init__(self):
self._clear()
@@ -77,7 +78,7 @@
class PersistentSecurityMap(SecurityMap, Persistent):
- __implements__ = ISecurityMap
+ implements(ISecurityMap)
def _clear(self):
self._byrow = PersistentDict()