[Zope-Checkins] CVS: Zope3/lib/python/Zope/App/Security - protectClass.py:1.1.2.10 publicClass.py:1.1.2.6 security-meta.zcml:1.1.2.2
Steve Alexander
steve@cat-box.net
Sun, 10 Mar 2002 19:11:26 -0500
Update of /cvs-repository/Zope3/lib/python/Zope/App/Security
In directory cvs.zope.org:/tmp/cvs-serv10945/lib/python/Zope/App/Security
Modified Files:
Tag: Zope-3x-branch
protectClass.py publicClass.py security-meta.zcml
Log Message:
Changed zcml security syntax to remove the "method=" attribute, and allow
only the "methods=" attribute.
=== Zope3/lib/python/Zope/App/Security/protectClass.py 1.1.2.9 => 1.1.2.10 ===
def __init__(self, name, permission_id=None, interface=None,
- method=None, methods=None):
+ methods=None):
self.__class = resolve(name)
self.__name = name
self.__permission_id = permission_id
- self.__r = self.protect(permission_id, interface, method, methods)
+ self.__r = self.protect(permission_id, interface, methods)
# So subsequent simple-declaration-style self() calls process instances
self.__empty = 1
@@ -65,13 +65,12 @@
else:
return permission_id
- def protect(self, permission_id=None, interface=None,
- method=None, methods=None):
+ def protect(self, permission_id=None, interface=None, methods=None):
"Protect a specific aspect"
self.__empty = 0
- if not (interface or method or methods):
+ if not (interface or methods):
return []
permission_id = self._getPermission(permission_id)
@@ -79,8 +78,6 @@
if interface:
self.__protectByInterface(interface, permission_id, r)
- if method:
- self.__protectMethod(method, permission_id, r)
if methods:
self.__protectMethods(methods, permission_id, r)
=== Zope3/lib/python/Zope/App/Security/publicClass.py 1.1.2.5 => 1.1.2.6 ===
def __init__(self, name, permission_id=None, interface=None,
- method=None, methods=None):
+ methods=None):
self._getPermission(permission_id) # Prohibit explicit permission!
protectClass.__init__(self, name, permission_id=PublicPermission,
- interface=interface, method=method,
- methods=methods)
+ interface=interface, methods=methods)
def _getPermission(self, permission_id=None):
if permission_id not in [None, PublicPermission]:
=== Zope3/lib/python/Zope/App/Security/security-meta.zcml 1.1.2.1 => 1.1.2.2 ===
handler="Zope.App.Security.metaConfigure.defineRole" />
<directive name="protectClass"
- attributes="name, permission_id, interface, method, methods"
+ attributes="name, permission_id, interface, methods"
handler="Zope.App.Security.protectClass.">
<subdirective name="protect"
- attributes="permission_id, interface, method, methods" />
+ attributes="permission_id, interface, methods" />
<subdirective name="instances" attributes="permission_id" />
</directive>
- <directive name="publicClass" attributes="name, interface, method, methods"
+ <directive name="publicClass" attributes="name, interface, methods"
handler="Zope.App.Security.publicClass." />
<directive name="defaultPolicy" attributes="name"
handler="Zope.App.Security.metaConfigure.defaultPolicy" />