Bug: Anon Users only see 'published' state.

36 views
Skip to first unread message

Jens W. Klein

unread,
Sep 6, 2012, 4:22:00 AM9/6/12
to eea-facete...@googlegroups.com, Benjamin Stefaner
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

Alin Voinea

unread,
Sep 6, 2012, 4:50:45 AM9/6/12
to eea-facete...@googlegroups.com, Jens W. Klein, Benjamin Stefaner
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

Jens W. Klein

unread,
Sep 6, 2012, 11:13:27 AM9/6/12
to alin....@gmail.com, eea-facete...@googlegroups.com, Benjamin Stefaner
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

Alin Voinea

unread,
Sep 6, 2012, 12:39:47 PM9/6/12
to Jens W. Klein, eea-facete...@googlegroups.com, Benjamin Stefaner
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"
Reply all
Reply to author
Forward
0 new messages