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

Mailing List Archive: Zope: CMF

Weird catalog behaviour

 

 

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


charlie at begeistert

Jan 28, 2009, 6:33 AM

Post #1 of 10 (802 views)
Permalink
Weird catalog behaviour

Hi,

is there any reason why a portal_catalog.searchResults() returns an
empty result set when called on the command line but not from within
ZMI? It is the same catalog and I can items to it but I just can't run
a search on it. Any ideas?

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

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


lists at zopyx

Jan 28, 2009, 6:44 AM

Post #2 of 10 (764 views)
Permalink
Re: Weird catalog behaviour [In reply to]

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 28.01.2009 15:33 Uhr, Charlie Clark wrote:
> Hi,
>
> is there any reason why a portal_catalog.searchResults() returns an
> empty result set when called on the command line but not from within
> ZMI? It is the same catalog and I can items to it but I just can't run
> a search on it. Any ideas?

Command-line (zopectl debug?): you're anonymous
ZMI: you're authenticated

The catalog adds additional filters under the hood in order to filter
out content you are not allowed to see.

- -aj

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (Darwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAkmAbzoACgkQCJIWIbr9KYxa5wCeMxC9OOWcehNRUKz9xgncs6P/
WC4AoOlcfKL0NtfsqnK0p2FsfDB6o5U0
=Idk4
-----END PGP SIGNATURE-----
Attachments: lists.vcf (0.31 KB)


charlie at begeistert

Jan 28, 2009, 6:52 AM

Post #3 of 10 (764 views)
Permalink
Re: Weird catalog behaviour [In reply to]

Am 28.01.2009 um 15:44 schrieb Andreas Jung:

> Command-line (zopectl debug?): you're anonymous
> ZMI: you're authenticated
>
> The catalog adds additional filters under the hood in order to filter
> out content you are not allowed to see.


That could be the explanation - how can I authenticate myself in
zopectl debug?

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

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


lists at zopyx

Jan 28, 2009, 6:54 AM

Post #4 of 10 (765 views)
Permalink
Re: Weird catalog behaviour [In reply to]

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 28.01.2009 15:52 Uhr, Charlie Clark wrote:
> Am 28.01.2009 um 15:44 schrieb Andreas Jung:
>
>> Command-line (zopectl debug?): you're anonymous
>> ZMI: you're authenticated
>>
>> The catalog adds additional filters under the hood in order to filter
>> out content you are not allowed to see.
>
>
> That could be the explanation - how can I authenticate myself in
> zopectl debug?
>

from AccessControl.SecurityManagement import newSecurityManager
user = app.acl_users.getUser(user_name_or_id)
newSecurityManager(None, user.__of__(app.acl_users))

Andreas
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (Darwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAkmAcZIACgkQCJIWIbr9KYz0eACeKS60A0Ul3K9R5UOWpA10kB1g
j+AAoKnST3497uMEmZcmQlgS3zxWG7Ji
=Kv1B
-----END PGP SIGNATURE-----
Attachments: lists.vcf (0.31 KB)


charlie at begeistert

Jan 28, 2009, 7:05 AM

Post #5 of 10 (766 views)
Permalink
Re: Weird catalog behaviour [In reply to]

Am 28.01.2009 um 15:54 schrieb Andreas Jung:

> from AccessControl.SecurityManagement import newSecurityManager
> user = app.acl_users.getUser(user_name_or_id)
> newSecurityManager(None, user.__of__(app.acl_users))


That does indeed solve the problem!

Cheers

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

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


tseaver at palladion

Jan 28, 2009, 12:41 PM

Post #6 of 10 (758 views)
Permalink
Re: Weird catalog behaviour [In reply to]

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Charlie Clark wrote:
> Am 28.01.2009 um 15:44 schrieb Andreas Jung:
>
>> Command-line (zopectl debug?): you're anonymous
>> ZMI: you're authenticated
>>
>> The catalog adds additional filters under the hood in order to filter
>> out content you are not allowed to see.
>
>
> That could be the explanation - how can I authenticate myself in
> zopectl debug?

You can also call the 'unrestrictedSearchResults' method from trusted
code (e.g., the debugger): it bypasses those checks.


Tres.
- --
===================================================================
Tres Seaver +1 540-429-0999 tseaver[at]palladion.com
Palladion Software "Excellence by Design" http://palladion.com
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFJgML6+gerLs4ltQ4RAtbpAJ4mUe+r+JYPiaKhIS3d0NBtJcZQZgCgiswu
8Q3IN6aFKTQ08aSNXUOF2as=
=YqHX
-----END PGP SIGNATURE-----

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

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


tseaver at palladion

Jan 28, 2009, 12:41 PM

Post #7 of 10 (758 views)
Permalink
Re: Weird catalog behaviour [In reply to]

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Charlie Clark wrote:
> Am 28.01.2009 um 15:44 schrieb Andreas Jung:
>
>> Command-line (zopectl debug?): you're anonymous
>> ZMI: you're authenticated
>>
>> The catalog adds additional filters under the hood in order to filter
>> out content you are not allowed to see.
>
>
> That could be the explanation - how can I authenticate myself in
> zopectl debug?

You can also call the 'unrestrictedSearchResults' method from trusted
code (e.g., the debugger): it bypasses those checks.


Tres.
- --
===================================================================
Tres Seaver +1 540-429-0999 tseaver[at]palladion.com
Palladion Software "Excellence by Design" http://palladion.com
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFJgML6+gerLs4ltQ4RAtbpAJ4mUe+r+JYPiaKhIS3d0NBtJcZQZgCgiswu
8Q3IN6aFKTQ08aSNXUOF2as=
=YqHX
-----END PGP SIGNATURE-----

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

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


charlie at begeistert

Jan 31, 2009, 5:36 AM

Post #8 of 10 (748 views)
Permalink
Re: Weird catalog behaviour [In reply to]

Am 28.01.2009 um 21:41 schrieb Tres Seaver:

> You can also call the 'unrestrictedSearchResults' method from trusted
> code (e.g., the debugger): it bypasses those checks.


I should have guessed that there'd be a method like that! Still thanks
to Andreas I now know how to behave like a user in zopectl debug. I
think this is the first time I've come across restrictions in it.

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.zope.org
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

Feb 1, 2009, 9:14 AM

Post #9 of 10 (741 views)
Permalink
Re: Weird catalog behaviour [In reply to]

Charlie Clark wrote:
> Am 28.01.2009 um 21:41 schrieb Tres Seaver:
>
>> You can also call the 'unrestrictedSearchResults' method from trusted
>> code (e.g., the debugger): it bypasses those checks.
>
>
> I should have guessed that there'd be a method like that! Still thanks
> to Andreas I now know how to behave like a user in zopectl debug. I
> think this is the first time I've come across restrictions in it.

You never called 'invokeFactory' in a debug session? ;-)

(due to the explicit security check in the process this
fails for anonymous)

Never mind,

Raphael

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

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


charlie at begeistert

Feb 1, 2009, 9:35 AM

Post #10 of 10 (743 views)
Permalink
Re: Weird catalog behaviour [In reply to]

Am 01.02.2009 um 18:14 schrieb Raphael Ritz:

> You never called 'invokeFactory' in a debug session? ;-)
>
> (due to the explicit security check in the process this
> fails for anonymous)


No, don't use invokeFactory in any of our stuff. Thanks to Yuppie,
we've gone passed go and moved straight onto using createObject() - we
sort of opt-in to bits of the CMF when we understand them! ;-)

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.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 RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact lists@gossamer-threads.com
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.