On 07/06/2011 10:59 AM, Hanno Schlichting wrote:
> The ZMI is a highly insecure, completely outdated and user-unfriendly 
> interface.

As I read this, I got an idea for a possible way forward.  I haven't 
been reading zope-dev much lately, so forgive me if something like this 
has been mentioned already.

What if we had decorators that let us disable old code by default, yet 
allowed users to enable the old code with configuration?  Something like 

import zope.oldcode

class SomeClass(SimpleObject):

     def manage_edit(self, REQUEST):
         # ...

The idea here is we'll create a zope.oldcode egg and fill it with 
decorators for pervasive features of Zope that need to be removed over 
time, such as the current ZMI.  We'll also create a configuration switch 
for each of those old features so that people can keep using them for a 
reasonable period of time.  When the "zmi" feature is disabled, the code 
above will replace the manage_edit method with a "zope.oldcode.Disabled" 
object that raises a helpful exception if anyone tries to call it.

It would also be good to make these decorators implement __nonzero__ to 
allow conditional attribute definition:

     if zope.oldcode.zmi:
         manage_properties = (...)

I would want to make sure conditional tests are possible as well:

     def test_manage_edit(self):
         # ...

(The zope.oldcode package probably ought to enable all old features by 
default when running tests.)

What do you think?


Zope-Dev maillist  -  Zope-Dev@zope.org
**  No cross posts or HTML encoding!  **
(Related lists - 
 https://mail.zope.org/mailman/listinfo/zope )

Reply via email to