[Zope-CMF] Action contexts?
Florent Guillaume
fg@nuxeo.com
Fri, 4 Oct 2002 13:42:16 +0000 (UTC)
Chris Withers <chrisw@nipltd.com> wrote:
> John Morton wrote:
> > Part of the reason is that worklists default to appearing in the
> > global section of the action box, and global actions are evaluated
> > in the context of the site root. However, switching to an action
> > catagory which results in the action being evaluated in the context
> > of the object you're looking at could get confusing -
>
> Wow, I wasn't aware the context an action was evaluated in was
> different depending on what category it was in :-(
An action is not evaluated in a context, as all context is explicit in
TALES.
What needs to be evaluated in a context is the Permission setting. There
are 3 possible contexts:
- the object being rendered
- the folder it belongs to
- the portal
The rule is that any action with category beginning with 'object' or
'workflow' is evaluated in object context, a category beginning with
'folder' is evaluated in folder context, otherwise in the portal context.
> Where is this documented?
This was explained in the checkin message for that change,
http://cvs.zope.org/CMF/CMFCore/ActionsTool.py?rev=1.28&content-type=text/vnd.viewcvs-markup
But as for the rest of CMF, it's not very documented.
The change should have been added to CHANGES.txt, even if the old
behavior wasn't documented either.
> What happens if you define new categories?
It now depends on their prefix. Before the change, they were always
evaluated in portal context.
Florent
--
Florent Guillaume, Nuxeo (Paris, France)
+33 1 40 33 79 87 http://nuxeo.com mailto:fg@nuxeo.com