Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Zope: CMF

MembershipTool: Using traversal to look up the Members folder?

 

 

Zope cmf RSS feed   Index | Next | Previous | View Threaded


r.ritz at biologie

Oct 8, 2008, 4:36 AM

Post #1 of 11 (1598 views)
Permalink
MembershipTool: Using traversal to look up the Members folder?

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




_______________________________________________
Zope-CMF maillist - Zope-CMF [at] lists
http://mail.zope.org/mailman/listinfo/zope-cmf

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


wichert at wiggy

Oct 8, 2008, 4:46 AM

Post #2 of 11 (1535 views)
Permalink
Re: MembershipTool: Using traversal to look up the Members folder? [In reply to]

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 <wichert [at] wiggy> It is simple to make things.
http://www.wiggy.net/ It is hard to make things simple.
_______________________________________________
Zope-CMF maillist - Zope-CMF [at] lists
http://mail.zope.org/mailman/listinfo/zope-cmf

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


jens at dataflake

Oct 8, 2008, 5:57 AM

Post #3 of 11 (1543 views)
Permalink
Re: MembershipTool: Using traversal to look up the Members folder? [In reply to]

-----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 [at] lists
http://mail.zope.org/mailman/listinfo/zope-cmf

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


r.ritz at biologie

Oct 8, 2008, 8:44 AM

Post #4 of 11 (1531 views)
Permalink
Re: MembershipTool: Using traversal to look up the Members folder? [In reply to]

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 [at] lists
http://mail.zope.org/mailman/listinfo/zope-cmf

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


r.ritz at biologie

Oct 8, 2008, 8:55 AM

Post #5 of 11 (1532 views)
Permalink
Re: MembershipTool: Using traversal to look up the Members folder? [In reply to]

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 [at] lists
> 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 [at] lists
http://mail.zope.org/mailman/listinfo/zope-cmf

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


charlie at begeistert

Oct 8, 2008, 9:00 AM

Post #6 of 11 (1530 views)
Permalink
Re: MembershipTool: Using traversal to look up the Members folder? [In reply to]

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 [at] lists
http://mail.zope.org/mailman/listinfo/zope-cmf

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


dieter at handshake

Oct 10, 2008, 11:13 PM

Post #7 of 11 (1519 views)
Permalink
Re: MembershipTool: Using traversal to look up the Members folder? [In reply to]

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 [at] lists
http://mail.zope.org/mailman/listinfo/zope-cmf

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


dieter at handshake

Oct 10, 2008, 11:16 PM

Post #8 of 11 (1520 views)
Permalink
Re: MembershipTool: Using traversal to look up the Members folder? [In reply to]

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 [at] lists
http://mail.zope.org/mailman/listinfo/zope-cmf

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


jens at dataflake

Oct 11, 2008, 12:21 AM

Post #9 of 11 (1513 views)
Permalink
Re: MembershipTool: Using traversal to look up the Members folder? [In reply to]

-----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 [at] lists
http://mail.zope.org/mailman/listinfo/zope-cmf

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


l at lrowe

Oct 11, 2008, 3:55 PM

Post #10 of 11 (1515 views)
Permalink
Re: MembershipTool: Using traversal to look up the Members folder? [In reply to]

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 [at] lists
http://mail.zope.org/mailman/listinfo/zope-cmf

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


dieter at handshake

Oct 11, 2008, 11:19 PM

Post #11 of 11 (1504 views)
Permalink
Re: MembershipTool: Using traversal to look up the Members folder? [In reply to]

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 [at] lists
http://mail.zope.org/mailman/listinfo/zope-cmf

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

Zope cmf RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.