[Zope-CMF] Catalog and usability

Jeff Sasmor jeff@janix.com
Wed, 18 Apr 2001 12:59:47 -0400


Disclaimer: I am using a 2 week old cvs release
of CMF, so perhaps this behavio(u)r has changed:
if so 'never mind'

Has anyone noticed that if you search a CMF portal,
say, by using the search box at the top of the page,
that the results displayed include unpublished items?

It's somewhat crude that when someone clicks on such items
will get a confusing  'unauthorized' message (unless that
person is the owner or a  reviewer or a manager but not
a mere portal member).

It would be nice to modify this so that it looked at the
review state of an item and only show published items.

But it isn't that easy! (^&@#^$#)

You might think you could add something like:


<dtml-let
review_state="portal_workflow.getInfoFor(portal_catalog.getobject(data_recor
d_id_),'review_state', '')">
   <dtml-if review_state>
 Status: &dtml-review_state;<br>
 </dtml-if>
</dtml-let>


to see the status of an item, and then you could write additional code to
filter out those that are unpublished (although of course it gets more
complex than that sounds to still have the <dtml-in> iteration work
correctly WRT paging.

Anyway, this won't work.

With the default implementation of  CMFCore/DefaultWorkflow.py,
one cannot check the review state of an object if you are anonymous
or not the owner.

line
277       allow_review = _checkPermission('Review portal content', ob)
278      allow_request = _checkPermission('Request review', ob)

So if  you don't have the Review Portal Content permission (assigned to
the reviewer role in the portal root) or the Request Review permission
(assigned to the Owner role in the the Zope root folder and acquired)
then when you try to get the review status of a portalcontent item then
you get a None back.

I might perhaps be slightly off in the details, but I am not sure why it's
important that the review state of an item is at all private.  I know one
possible answer might be to 'write your own workflow', but this one
inherent behavior of the default workflow leads me to ask - why is
it like this?

I'd like to suggest that this issue be revisited by the CMF developers and
perhaps modified.  It would be really great if out-of-the-box CMFs
search feature didn't display items that cannot be viewed, if for no reasons
other than UI consistency and reduced confusatory entropification.

Jeff Sasmor

Jeff Sasmor
jeff@sasmor.com
Check out http://www.naggle.com/