[Zope3-checkins] CVS: Zope3/src/zope/products/securitypolicy - principalrole.py:1.1.2.3 role.py:1.1.2.3 rolepermission.py:1.1.2.3

Chris McDonough chrism at plope.com
Wed Jan 14 01:38:52 EST 2004


Update of /cvs-repository/Zope3/src/zope/products/securitypolicy
In directory cvs.zope.org:/tmp/cvs-serv31942/src/zope/products/securitypolicy

Modified Files:
      Tag: steveachrismcd-securitypolicy-branch
	principalrole.py role.py rolepermission.py 
Log Message:
Tease out some of the last bits of the role machinery from the zope/app and zope/security packages.  What remains: translation files and some various page templates.


=== Zope3/src/zope/products/securitypolicy/principalrole.py 1.1.2.2 => 1.1.2.3 ===
--- Zope3/src/zope/products/securitypolicy/principalrole.py:1.1.2.2	Wed Jan 14 01:06:48 2004
+++ Zope3/src/zope/products/securitypolicy/principalrole.py	Wed Jan 14 01:38:21 2004
@@ -27,7 +27,7 @@
 from zope.products.securitypolicy.securitymap import PersistentSecurityMap
 
 from zope.app.security.principal import checkPrincipal
-from zope.app.security.role import checkRole
+from zope.products.securitypolicy.role import checkRole
 
 annotation_key = 'zope.app.security.AnnotationPrincipalRoleManager'
 


=== Zope3/src/zope/products/securitypolicy/role.py 1.1.2.2 => 1.1.2.3 ===
--- Zope3/src/zope/products/securitypolicy/role.py:1.1.2.2	Wed Jan 14 01:06:48 2004
+++ Zope3/src/zope/products/securitypolicy/role.py	Wed Jan 14 01:38:21 2004
@@ -25,6 +25,7 @@
 from zope.app.component.nextservice import getNextService
 from zope.app.interfaces.services.service import ISimpleService
 from zope.interface import implements
+from zope.component import getService
 
 class Role(Role, Persistent):
     "Persistent Role"
@@ -54,3 +55,7 @@
         if roleserv:
             roles.extend(roleserv.getRoles())
         return roles
+
+def checkRole(context, role_id):
+    if not getService(context, 'Roles').getRole(role_id):
+        raise ValueError("Undefined role id", role_id)


=== Zope3/src/zope/products/securitypolicy/rolepermission.py 1.1.2.2 => 1.1.2.3 ===
--- Zope3/src/zope/products/securitypolicy/rolepermission.py:1.1.2.2	Wed Jan 14 01:06:48 2004
+++ Zope3/src/zope/products/securitypolicy/rolepermission.py	Wed Jan 14 01:38:21 2004
@@ -21,7 +21,7 @@
 from zope.app.interfaces.annotation import IAnnotations
 
 from zope.app.security.settings import Allow, Deny, Unset
-from zope.app.security.role import checkRole
+from zope.products.securitypolicy.role import checkRole
 from zope.app.security.permission import checkPermission
 
 from zope.products.securitypolicy.interfaces import IRolePermissionManager




More information about the Zope3-Checkins mailing list