Re: [Zope3-Users] Question about IOrderedContainer interface

2007-02-27 Thread Thierry Florac
Le lundi 26 février 2007 à 19:39 +0200, Marius Gedminas a écrit :
 On Mon, Feb 26, 2007 at 05:28:12PM +0100, Thierry Florac wrote:
  I have a little question about the IOrderedContainer interface.
  
  Actually, this interface is derived from IContainer, and only contains
  a single method, updateOrder() which is an updating method.
  
  When I create a subclass of OrderedContainer for which I'd like only a
  limited set of roles to have reordering permission,
 ...
  So I can see only three ways to make this working :
 ...
   - wait for someone else to give me another solution, which wouldn't
  need to modify Zope source code :-)
 
 require
   interface=IReadContainer
   permission=zope.View /
 require
   interface=IWriteContainer
   permission=zope.ManageContent /
 require
   attributes=updateOrder
   permission=zope.ManageContent /

I agree with you that I can use this workaround.
But is it really fine to define a writing interface as a sub-interface
of IReadContainer which, as said before, just need reading
permissions ??
Using attributes here in ZCML is only OK because we have a single
method in IOrderedContainer interface...

Thanks anyway,

  Thierry Florac
-- 
  Chef de projet intranet/internet
  Office National des Forêts - Département Informatique
  2, Avenue de Saint-Mandé
  75570 PARIS Cedex 12
  Mél : [EMAIL PROTECTED]
  Tél. : +33 01.40.19.59.64
  Fax. : +33 01.40.19.59.85

___
Zope3-users mailing list
Zope3-users@zope.org
http://mail.zope.org/mailman/listinfo/zope3-users


[Zope3-Users] Question about IOrderedContainer interface

2007-02-26 Thread Thierry Florac

  Hi,

I have a little question about the IOrderedContainer interface.

Actually, this interface is derived from IContainer, and only contains
a single method, updateOrder() which is an updating method.

When I create a subclass of OrderedContainer for which I'd like only a
limited set of roles to have reordering permission, I'd like to do
something like :

  require
interface=IReadContainer
permission=zope.View /
  require
interface=IOrderedContainer
permission=zope.ManageContent /

But this doesn't work, because of a ConfigurationConflictError.

So I can see only three ways to make this working :
 - make IOrderedContainer derived from IWriteContainer instead of
IContainer (what I've done until now !)
 - make IOrderedContainer a separate interface, so that I could do
something like :

  require
interface=IReadContainer
permission=zope.View /
  require
interface=IWriteContainer
permission=zope.ManageContent /
  require
interface=IOrderedContainer
permission=zope.ManageContent /

 - wait for someone else to give me another solution, which wouldn't
need to modify Zope source code :-)

Thanks for any help or advise,

  Thierry Florac
-- 
  Chef de projet intranet/internet
  Office National des Forêts - Département Informatique
  2, Avenue de Saint-Mandé
  75570 PARIS Cedex 12
  Mél : [EMAIL PROTECTED]
  Tél. : +33 01.40.19.59.64
  Fax. : +33 01.40.19.59.85

___
Zope3-users mailing list
Zope3-users@zope.org
http://mail.zope.org/mailman/listinfo/zope3-users


Re: [Zope3-Users] Question about IOrderedContainer interface

2007-02-26 Thread Martin Aspeli



Thierry FLORAC wrote:
 
 
   Hi,
 
 I have a little question about the IOrderedContainer interface.
 
 Actually, this interface is derived from IContainer, and only contains
 a single method, updateOrder() which is an updating method.
 

That's pretty silly, it should probably be IWriteContainer :-(

Note that if anyone's fixing OrderedContainer, the default implementation
isn't terribly optimal as well - it uses PersistentMappings and not BTrees.
I've got impementations where I wanted to reuse it but use a BTree, and I've
done things like this:
http://svn.plone.org/svn/plone/plone.portlets/trunk/plone/portlets/storage.py

Martin
-- 
View this message in context: 
http://www.nabble.com/Question-about-IOrderedContainer-interface-tf3293814.html#a9162073
Sent from the Zope3 - users mailing list archive at Nabble.com.

___
Zope3-users mailing list
Zope3-users@zope.org
http://mail.zope.org/mailman/listinfo/zope3-users


Re: [Zope3-Users] Question about IOrderedContainer interface

2007-02-26 Thread Marius Gedminas
On Mon, Feb 26, 2007 at 05:28:12PM +0100, Thierry Florac wrote:
 I have a little question about the IOrderedContainer interface.
 
 Actually, this interface is derived from IContainer, and only contains
 a single method, updateOrder() which is an updating method.
 
 When I create a subclass of OrderedContainer for which I'd like only a
 limited set of roles to have reordering permission,
...
 So I can see only three ways to make this working :
...
  - wait for someone else to give me another solution, which wouldn't
 need to modify Zope source code :-)

require
  interface=IReadContainer
  permission=zope.View /
require
  interface=IWriteContainer
  permission=zope.ManageContent /
require
  attributes=updateOrder
  permission=zope.ManageContent /

Marius Gedminas
-- 
There's an old story about the person who wished his computer were as easy to
use as his telephone. That wish has come true, since I no longer know how to
use my telephone.
-- Bjarne Stroustrup


signature.asc
Description: Digital signature
___
Zope3-users mailing list
Zope3-users@zope.org
http://mail.zope.org/mailman/listinfo/zope3-users