Re: [Zope-CMF] MembershipTool: Using traversal to look up the Members folder?

2008-10-11 Thread Dieter Maurer
Jens Vagelpohl wrote at 2008-10-11 09:21 +0200:
>-BEGIN PGP SIGNED MESSAGE-
>Hash: SHA1
>
>
>On Oct 11, 2008, at 08:16 , Dieter Maurer wrote:
>
>> Jens Vagelpohl wrote at 2008-10-8 14:57 +0200:
>>> ...
>>> As far as the feature itself is concerned, I've never seen a  
>>> situation
>>> where this is useful or needed.
>>
>> As so often -- we need it :-)
>> Our "MembershipTool" instance is (together with the portal)
>> in a read only mounted storage
>> while the "Members" folder obviously has to be in a read/write mounted
>> storage.
>
>As so often, you have never mentioned that this is useful or  
>needed ;-)

I did -- in the message you have reponded to ;-)
I did this to support Raphael's extension request.

For us, there was no need to change "CMFDefault" (which we do not use
at all) nor "CMFCore". Instead, we implemented the additional
flexibility in a class derived from "CMFCore.MembershipTool.MembershipTool".

> Seriously, I know you may have some use cases that few of  
>use will ever see or need, but if there's no feedback at all then it's  
>not possible to consider them.

Sure. And my response had not the intension to blame the CMF developpers
why a much needed feature is still not available
but only to threnghen Raphaels request for a minor extension :-)

>If you have a fully-tested patch I'll be happy to look at it.

As I understood, Raphael has one. I do not as we have a separate
"MembershipTool" (only derived from that of "CMFCore").

@Raphael: I suggest to put the extra flexibility into "CMFCore" (and not
only into "CMFDefault").



-- 
Dieter
___
Zope-CMF maillist  -  Zope-CMF@lists.zope.org
http://mail.zope.org/mailman/listinfo/zope-cmf

See https://bugs.launchpad.net/zope-cmf/ for bug reports and feature requests


Re: [Zope-CMF] MembershipTool: Using traversal to look up the Members folder?

2008-10-11 Thread Laurence Rowe
Raphael Ritz wrote:
> Hi,
> 
> today I'm facing the situation where I want to support a Members folder
> (rare these days) but this folder should be deeper down in the site
> (very rare; for me this is the first time ever).
> 
> Currently, CMF(Default - and Plone for that matter) does not support
> this OOTB because CMFDefault's MembershipTool uses a simple getattr
> call for the 'membersfolder_id' on the site object.
> Changing this to use 'unrestrictedTraverse' instead resolves
> the problem including the possibility to specify the path (or
> relative content URL) to the folder in ZMI.
> 
> It does break two tests, however, as the  DummySite's
> 'unrestrictedTraverse' used for testing isn't clever
> enough to deal with relative paths/URLs correctly.
> 
> Now my question: Is this something CMFDefault should support?
> If so, I'm happy to file a ticket with a patch (and test;
> I don't have repository access).
> If not, I will simply keep on patching my local installation.
> 
> Just thought I'll let you know. Opinions anyone?
> 
> Raphael

We've needed this functionality recently too.

+1 for both using a configurable path and moving the implementation to 
CMFCore.

While we're on the subject I think we should change the defaults to 
match the common case of not having a members area. So change 
memberareaCreationFlag to False, and do not create the Member folder at 
all in the default profile.

Laurence

___
Zope-CMF maillist  -  Zope-CMF@lists.zope.org
http://mail.zope.org/mailman/listinfo/zope-cmf

See https://bugs.launchpad.net/zope-cmf/ for bug reports and feature requests


Re: [Zope-CMF] MembershipTool: Using traversal to look up the Members folder?

2008-10-11 Thread Jens Vagelpohl
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1


On Oct 11, 2008, at 08:16 , Dieter Maurer wrote:

> Jens Vagelpohl wrote at 2008-10-8 14:57 +0200:
>> ...
>> As far as the feature itself is concerned, I've never seen a  
>> situation
>> where this is useful or needed.
>
> As so often -- we need it :-)
> Our "MembershipTool" instance is (together with the portal)
> in a read only mounted storage
> while the "Members" folder obviously has to be in a read/write mounted
> storage.

As so often, you have never mentioned that this is useful or  
needed ;-)  Seriously, I know you may have some use cases that few of  
use will ever see or need, but if there's no feedback at all then it's  
not possible to consider them.

If you have a fully-tested patch I'll be happy to look at it.

jens


-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.8 (Darwin)

iEYEARECAAYFAkjwU94ACgkQRAx5nvEhZLLofgCffohn0jgS9+X8yT2WbQSCc7Rd
24kAoJv42TfniCfuh+YEtg7mUb41g0QG
=9YRS
-END PGP SIGNATURE-
___
Zope-CMF maillist  -  Zope-CMF@lists.zope.org
http://mail.zope.org/mailman/listinfo/zope-cmf

See https://bugs.launchpad.net/zope-cmf/ for bug reports and feature requests


Re: [Zope-CMF] MembershipTool: Using traversal to look up the Members folder?

2008-10-10 Thread Dieter Maurer
Jens Vagelpohl wrote at 2008-10-8 14:57 +0200:
> ...
>As far as the feature itself is concerned, I've never seen a situation  
>where this is useful or needed.

As so often -- we need it :-)
Our "MembershipTool" instance is (together with the portal)
in a read only mounted storage
while the "Members" folder obviously has to be in a read/write mounted
storage.



-- 
Dieter
___
Zope-CMF maillist  -  Zope-CMF@lists.zope.org
http://mail.zope.org/mailman/listinfo/zope-cmf

See https://bugs.launchpad.net/zope-cmf/ for bug reports and feature requests


Re: [Zope-CMF] MembershipTool: Using traversal to look up the Members folder?

2008-10-10 Thread Dieter Maurer
Raphael Ritz wrote at 2008-10-8 13:36 +0200:
>Currently, CMF(Default - and Plone for that matter) does not support
>this OOTB because CMFDefault's MembershipTool uses a simple getattr
>call for the 'membersfolder_id' on the site object.
>Changing this to use 'unrestrictedTraverse' instead resolves
>the problem including the possibility to specify the path (or
>relative content URL) to the folder in ZMI.

We are using this -- with our own implementation of the "MembershipTool",
derived from the one provided by "CMFCore".



-- 
Dieter
___
Zope-CMF maillist  -  Zope-CMF@lists.zope.org
http://mail.zope.org/mailman/listinfo/zope-cmf

See https://bugs.launchpad.net/zope-cmf/ for bug reports and feature requests


Re: [Zope-CMF] MembershipTool: Using traversal to look up the Members folder?

2008-10-08 Thread Charlie Clark

Am 08.10.2008 um 14:57 schrieb Jens Vagelpohl:

> Please keep in mind the true nature of CMFDefault: It's a sample
> application of the framework laid down in CMFCore.

True but an eminently usable one.

> So IMHO _if_ this
> kind of configurable members folder location feature is added, it
> should be in CMFCore and thus available to CMFDefault.

Very true.

> As far as the feature itself is concerned, I've never seen a situation
> where this is useful or needed. So my vote as far as the CMF is
> concerned is +-0 because it's a "YAGNI" feature, You Ain't Going to
> Need It. I'd say the correct place would be a custom membership tool
> for your specific application that needs to support this use case.


+1 for ± 0 ;-)

Charlie
--
Charlie Clark
Helmholtzstr. 20
Düsseldorf
D- 40215
Tel: +49-211-938-5360
GSM: +49-178-782-6226



___
Zope-CMF maillist  -  Zope-CMF@lists.zope.org
http://mail.zope.org/mailman/listinfo/zope-cmf

See https://bugs.launchpad.net/zope-cmf/ for bug reports and feature requests


Re: [Zope-CMF] MembershipTool: Using traversal to look up the Members folder?

2008-10-08 Thread Raphael Ritz
Jens Vagelpohl wrote:
>

[..]

> 
> Please keep in mind the true nature of CMFDefault: It's a sample  
> application of the framework laid down in CMFCore. So IMHO _if_ this  
> kind of configurable members folder location feature is added, it  
> should be in CMFCore and thus available to CMFDefault.

That would be my thinking as well but seeing that the current
implementation in CMFCore is even less flexible (it looks for
a 'Members' object - hard-coded id - in the site root) and
that CMFDefault overrides this to allow configurability of
the object id at least I thought it would fit better there.
But I agree with you that should we consider this at all
CMFCore would be the more appropriate place to do it.

> 
> As far as the feature itself is concerned, I've never seen a situation  
> where this is useful or needed. So my vote as far as the CMF is  
> concerned is +-0 because it's a "YAGNI" feature, You Ain't Going to  
> Need It.

Which is why I wrote the little intro in my original posting
and why I posted this here as a question instead of filing
a bug report right away.

> I'd say the correct place would be a custom membership tool  
> for your specific application that needs to support this use case.

Which is perfectly fine with me as I said before.

Raphael


> 
> jens
> 
> -BEGIN PGP SIGNATURE-
> Version: GnuPG v1.4.8 (Darwin)
> 
> iEYEARECAAYFAkjsrkUACgkQRAx5nvEhZLKx3QCfS3u5pfLRG1H2AHnAVbGeiIHy
> nTEAoKGU7zm+ft+4CDMrQvzNzPQRXZJO
> =ei66
> -END PGP SIGNATURE-
> ___
> Zope-CMF maillist  -  Zope-CMF@lists.zope.org
> http://mail.zope.org/mailman/listinfo/zope-cmf
> 
> See https://bugs.launchpad.net/zope-cmf/ for bug reports and feature requests
> 

___
Zope-CMF maillist  -  Zope-CMF@lists.zope.org
http://mail.zope.org/mailman/listinfo/zope-cmf

See https://bugs.launchpad.net/zope-cmf/ for bug reports and feature requests


Re: [Zope-CMF] MembershipTool: Using traversal to look up the Members folder?

2008-10-08 Thread Raphael Ritz
Wichert Akkerman wrote:
> Previously Raphael Ritz wrote:
>> Currently, CMF(Default - and Plone for that matter) does not support
>> this OOTB because CMFDefault's MembershipTool uses a simple getattr
>> call for the 'membersfolder_id' on the site object.
>> Changing this to use 'unrestrictedTraverse' instead resolves
>> the problem including the possibility to specify the path (or
>> relative content URL) to the folder in ZMI.
> 
> Shouldn't it use restrictedTraverse? Is there a special reason you want
> to bypass security?

The reasons are:

(i) the current implementation doesn't check security either

(ii) 'getMembersFolder' while public is most often called from
'getHomeFolder' which does check security so I think it is not
necessary to check security twice. But should we change this at
all I would be fine with 'restrictedTraverse' as well (in the
sense of being defensive).

Raphael


> 
> Wichert.
> 

___
Zope-CMF maillist  -  Zope-CMF@lists.zope.org
http://mail.zope.org/mailman/listinfo/zope-cmf

See https://bugs.launchpad.net/zope-cmf/ for bug reports and feature requests


Re: [Zope-CMF] MembershipTool: Using traversal to look up the Members folder?

2008-10-08 Thread Jens Vagelpohl
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1


On Oct 8, 2008, at 13:36 , Raphael Ritz wrote:

> Hi,
>
> today I'm facing the situation where I want to support a Members  
> folder
> (rare these days) but this folder should be deeper down in the site
> (very rare; for me this is the first time ever).
>
> Currently, CMF(Default - and Plone for that matter) does not support
> this OOTB because CMFDefault's MembershipTool uses a simple getattr
> call for the 'membersfolder_id' on the site object.
> Changing this to use 'unrestrictedTraverse' instead resolves
> the problem including the possibility to specify the path (or
> relative content URL) to the folder in ZMI.
>
> It does break two tests, however, as the  DummySite's
> 'unrestrictedTraverse' used for testing isn't clever
> enough to deal with relative paths/URLs correctly.
>
> Now my question: Is this something CMFDefault should support?
> If so, I'm happy to file a ticket with a patch (and test;
> I don't have repository access).
> If not, I will simply keep on patching my local installation.
>
> Just thought I'll let you know. Opinions anyone?

Please keep in mind the true nature of CMFDefault: It's a sample  
application of the framework laid down in CMFCore. So IMHO _if_ this  
kind of configurable members folder location feature is added, it  
should be in CMFCore and thus available to CMFDefault.

As far as the feature itself is concerned, I've never seen a situation  
where this is useful or needed. So my vote as far as the CMF is  
concerned is +-0 because it's a "YAGNI" feature, You Ain't Going to  
Need It. I'd say the correct place would be a custom membership tool  
for your specific application that needs to support this use case.

jens

-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.8 (Darwin)

iEYEARECAAYFAkjsrkUACgkQRAx5nvEhZLKx3QCfS3u5pfLRG1H2AHnAVbGeiIHy
nTEAoKGU7zm+ft+4CDMrQvzNzPQRXZJO
=ei66
-END PGP SIGNATURE-
___
Zope-CMF maillist  -  Zope-CMF@lists.zope.org
http://mail.zope.org/mailman/listinfo/zope-cmf

See https://bugs.launchpad.net/zope-cmf/ for bug reports and feature requests


Re: [Zope-CMF] MembershipTool: Using traversal to look up the Members folder?

2008-10-08 Thread Wichert Akkerman
Previously Raphael Ritz wrote:
> Currently, CMF(Default - and Plone for that matter) does not support
> this OOTB because CMFDefault's MembershipTool uses a simple getattr
> call for the 'membersfolder_id' on the site object.
> Changing this to use 'unrestrictedTraverse' instead resolves
> the problem including the possibility to specify the path (or
> relative content URL) to the folder in ZMI.

Shouldn't it use restrictedTraverse? Is there a special reason you want
to bypass security?

Wichert.

-- 
Wichert Akkerman <[EMAIL PROTECTED]>It is simple to make things.
http://www.wiggy.net/   It is hard to make things simple.
___
Zope-CMF maillist  -  Zope-CMF@lists.zope.org
http://mail.zope.org/mailman/listinfo/zope-cmf

See https://bugs.launchpad.net/zope-cmf/ for bug reports and feature requests