I've been looking at some of the things that folks have been wanting to do with Organic Groups with CiviCRM, but cannot do currently. I've spent a fair amount of time looking at how to fit into its architecture, and have slowly come to the conclusion that the answer is "no where".
So I've been looking for an alternate way of integrating the kind of functionality that OG has with CiviCRM, without actually using OG. I'm trying something out that may be useful for this. I have a demo to show folks. It's not for the timid, but it appears to work. More in the flip...
It turns out that Drupal 5 has much better APIs for doing access control. The node_access system is not the easiest part of Drupal to understand, but with a bit of patience and John VanDyk's sample code, you can get something to work.
Here's a simple module that does this. Any node can be "attached" to a CiviCRM group. If a user is in a group, and the node is bound to that group, the user will have access. Otherwise, the user sees the "Access denied" page.
I'm attaching a tar ball to this entry. Try it out. You should read the comments at the top of the module page, since you need to set some permissions to keep my module and CiviCRM happy. I'm running this with the version of CiviNode in Drupal CVS HEAD. It may also work with the 5.x build, but YMMV :-)
Update: 6/13/07 -- I found an error in my edited version that I uploaded; it's missing a function. I've swapped the attached file to include the fixed version.
| Attachment | Size |
|---|---|
| civinode_access_demo.tar.gz | 2.76 KB |