[Zope-dev] Re: [Checkins] SVN: Zope/branches/Zope-2_8-branch/ - Backport a postonly decorator from Zope trunk's requestmethod decorator factory.

Stefan H. Holek stefan at epy.co.at
Wed Mar 21 06:50:58 EDT 2007


Python 2.3 does not support the @decorator syntax.

Cheers,
Stefan


On 20. Mär 2007, at 10:05, Martijn Pieters wrote:

> Log message for revision 73390:
>   - Backport a postonly decorator from Zope trunk's requestmethod  
> decorator factory.
>   - Protect various security-setting-mutators with this decorator.

> Modified: Zope/branches/Zope-2_8-branch/lib/python/AccessControl/ 
> PermissionMapping.py
> ===================================================================
> --- Zope/branches/Zope-2_8-branch/lib/python/AccessControl/ 
> PermissionMapping.py	2007-03-20 09:03:57 UTC (rev 73389)
> +++ Zope/branches/Zope-2_8-branch/lib/python/AccessControl/ 
> PermissionMapping.py	2007-03-20 09:05:56 UTC (rev 73390)
> @@ -26,10 +26,13 @@
>
>  from Owned import UnownableOwner
>  from Permission import pname
> +from requestmethod import postonly
>
>
>  class RoleManager:
>
> +    # XXX: No security declarations?
> +
>      def manage_getPermissionMapping(self):
>          """Return the permission mapping for the object
>
> @@ -54,6 +57,7 @@
>              a({'permission_name': ac_perms[0], 'class_permission':  
> p})
>          return r
>
> +    @postonly
>      def manage_setPermissionMapping(self,
>                                      permission_names=[],
>                                      class_permissions=[],  
> REQUEST=None):
>

--
Anything that, in happening, causes something else to happen,
causes something else to happen.  --Douglas Adams




More information about the Zope-Dev mailing list