[Zope-Checkins] CVS: Zope3/lib/python/Zope/App/Security - protectClass.py:1.1.2.14.2.2 security-meta.zcml:1.1.2.5.2.2 security.zcml:1.1.2.8.2.3
Jim Fulton
jim@zope.com
Mon, 3 Jun 2002 14:25:36 -0400
Update of /cvs-repository/Zope3/lib/python/Zope/App/Security
In directory cvs.zope.org:/tmp/cvs-serv14482/lib/python/Zope/App/Security
Modified Files:
Tag: Zope3InWonderland-branch
protectClass.py security-meta.zcml security.zcml
Log Message:
Changed list attribute syntax to be more XML standard.
In particular, list attributes now expect items to be separated by
whitespace, rather than commas.
=== Zope3/lib/python/Zope/App/Security/protectClass.py 1.1.2.14.2.1 => 1.1.2.14.2.2 ===
def __protectNames(self, names, permission, r):
"Set a permission on a bunch of names."
- for name in names.split(","):
+
+ if ',' in names:
+ raise TypeError("Names should not contain commas!")
+
+ for name in names.strip().split():
self.__protectName(name.strip(), permission, r)
def __protectByInterface(self, interface, permission, r):
=== Zope3/lib/python/Zope/App/Security/security-meta.zcml 1.1.2.5.2.1 => 1.1.2.5.2.2 ===
<directives namespace="http://namespaces.zope.org/security">
<directive name="permission"
- attributes="id, title, description"
+ attributes="id title description"
handler="Zope.App.Security.metaConfigure.definePermission" />
<directive name="role"
- attributes="id, title, description"
+ attributes="id title description"
handler="Zope.App.Security.metaConfigure.defineRole" />
<directive name="protectClass"
- attributes="class, permission, interface, names"
+ attributes="class permission interface names"
handler="Zope.App.Security.protectClass.">
<subdirective name="protect"
- attributes="permission, interface, names" />
+ attributes="permission interface names" />
</directive>
- <directive name="publicClass" attributes="class, interface, names"
+ <directive name="publicClass" attributes="class interface names"
handler="Zope.App.Security.publicClass." />
<directive name="defaultPolicy" attributes="name"
handler="Zope.App.Security.metaConfigure.defaultPolicy" />
- <directive name="principal" attributes="id, title, description"
+ <directive name="principal" attributes="id title description"
handler="Zope.App.Security.metaConfigure.principal" />
<directive name="defaultPrincipal"
- attributes="principal, title, description"
+ attributes="principal title description"
handler="Zope.App.Security.metaConfigure.defaultPrincipal" />
- <directive name="grantPermissionToRole" attributes="permission, role"
+ <directive name="grantPermissionToRole" attributes="permission role"
handler="Zope.App.Security.metaConfigure.grantPermissionToRole" />
<directive
name="grantPermissionToPrincipal"
- attributes="permission, principal"
+ attributes="permission principal"
handler="Zope.App.Security.metaConfigure.grantPermissionToPrincipal" />
- <directive name="assignRoleToPrincipal" attributes="role, principal"
+ <directive name="assignRoleToPrincipal" attributes="role principal"
handler="Zope.App.Security.metaConfigure.assignRoleToPrincipal" />
</directives>
=== Zope3/lib/python/Zope/App/Security/security.zcml 1.1.2.8.2.2 => 1.1.2.8.2.3 ===
class="Zope.App.Security.RolePermissionView.PermissionRoles."
permission="Zope.Security"
- names="roles, rolesInfo"
+ names="roles rolesInfo"
interface="Zope.App.Security.IRegisteredObject." />
<browser:view for="Zope.App.OFS.Annotation.IAnnotatable."
@@ -84,9 +84,10 @@
<security:protectClass class="Zope.App.Security.PrincipalPermissionView."
permission="Zope.Security"
- names="index, get_principal, unsetPermissions, denyPermissions,
- grantPermissions, getUnsetPermissionsForPrincipal,
- getPermissionsForPrincipal" />
+ names="index get_principal unsetPermissions denyPermissions
+ grantPermissions getUnsetPermissionsForPrincipal
+ getPermissionsForPrincipal
+ " />
<browser:view name="PrincipalPermissionsManagement"