Bug: Anon Users only see 'published' state.

Showing 1-4 of 4 messages
Bug: Anon Users only see 'published' state. Jens Klein 9/6/12 1:22 AM
Hi,

we digged into a problem we had while showing images and files in a
faceted navigation.

While everythings fine with logged-in users, results where empty for
anon users.

We then found criteria adds explicit a review_state query parameter
which is fixed to "published", see
https://github.com/collective/eea.facetednavigation/blob/master/eea/facetednavigation/browser/app/query.py#L87

This does not work for the types "Image" and "File" which do not have
any workflow by default. The permissions are inherited from its folder,
which is fine for most use-cases.

The current behaviour would also break for custom workflows using an
alternative name for the "published" state (we have this in other
projects, i.e. using http://pypi.python.org/pypi/bda.plone.wfintranet

Anyway, catalog queries do only show items allowed to see for anon
users. So I do not see any value of adding the review state.

I'd get rid of this special addition completly. If someone want to
fixate the workflow state its easy to use a hidden widget to achieve the
goal.

What do you think?

regards

Jens
--
Jens W. Klein
Gesch�ftsf�hrer
Partner der Klein & Partner KG

k l e i n  &  p a r t n e r
agentur f�r webtechnologien

Grabenweg 68
SOHO 2.0 - Penthouse Office 10
6020 Innsbruck
Austria

mob +43 699 1602019-0

fon +43 512 214320
fax +43 512 214320-1

web http://kleinundpartner.at

member of BlueDynamics Alliance
http://bluedynamics.com
Re: [faceted-navigation] Bug: Anon Users only see 'published' state. Alin Voinea 9/6/12 1:48 AM
Yap,

I think this check is there since Plone 2.5, but as you said, it should
be already fixed by catalog. Thus, go for it ;)

Cheers,
Alin
Re: [faceted-navigation] Bug: Anon Users only see 'published' state. Jens Klein 9/6/12 8:13 AM
On 2012-09-06 10:50, Alin Voinea wrote:
> Yap,
>
> I think this check is there since Plone 2.5, but as you said, it should
> be already fixed by catalog. Thus, go for it ;)

Ok, done at
https://github.com/collective/eea.facetednavigation/commit/9f8f1ce56d534036781082e731926c9a4f9bd035

regards Jens
Re: [faceted-navigation] Bug: Anon Users only see 'published' state. Alin Voinea 9/6/12 9:37 AM
Just for reference, if someone still needs exactly that functionality:

It can be solved TTW with a TAL Expression Facet for review_state index with this expression:

	python: 'published' if context.portal_membership.isAnonymousUser() else "FACET-EMPTY"