I'm using Workflow with OG, and I want particular workflow transitions to be available only to users with OG admin privileges over particular nodes.
I was looking at the workflow_allowable_transitions() function, to see if there was any way to alter the results it returns. The only possibility seems to be via hook_db_rewrite_sql(); but considering the complex UNION SQL query that this function performs, even that is probably not possible (and anyway modifying the DB query directly is not ideal).
Attached patch adds a hook_workflow_allowable_transitions_alter(), via a simple one-line drupal_alter() call.
| Comment | File | Size | Author |
|---|---|---|---|
| workflow_transitions_alter.patch | 331 bytes | Jaza |
Comments
Comment #1
Jaza commentedFYI, here is my implementation of the new alter hook:
Comment #2
Jaza commentedOops, my hook implementation above doesn't work (teach me to test before posting snippets!).
og_is_group_admin()needs to be passed the node of the group, not the node of the current page (which is assigned to the group). Once again, this is just FYI, for people who want to achieve the same OG to Workflow integration that I've set up:Comment #3
Bastlynn commentedSince this request is over 2 years old, I'm going to assume a solution was found or you've moved on. If not, please get updated to the latest versions of all modules and make a patch for it against Drupal 7 and I'll be glad to take a look at it.
Comment #4
johnvITMT the D7 version has new hooks doing just this. Please check workflow.api.php