Tuesday 01 April 2003 7:03:57 am
Workflows are designed to be used on one object at a time, this means only for the current object in a view and not on each item in a list.
What you can do here is the following:
1. Create a workflow event handler which detects the purchased product and stores in a database table that the user has the licence.
2. Create a template operator that takes a node ID as a parameter (or object ID if you wish), from the node ID you can figure out if the object requires licencing (by class ID or class group ID for instance). If so you check if the user has licence for it and return a special value, if not return another value. If the object is not for licencing return a third value.
Example of values:
0 - No licening, free for use
1 - Licenced, but no licence bought 2 - Licenced, and has licence 3. Add the operator to all your lists, where you check each item with the operator and displays one piece of template code if they have access or another if they don't. I've done something similar a user could be subscribed to some sections, be able to buy in others and free use for specific classes.
The main problem here is cache, since cache is determined by the which roles you are related to two users with the same role will get the same content allthough one has bougth the licence and the other has not. A solution to this (besides turning of caching) is to create a dummy role which a user is assigned to when the licence is bought. Does this help?
--
Amos
Documentation: http://ez.no/ez_publish/documentation
FAQ: http://ez.no/ez_publish/documentation/faq
|