Hi all. I'm staring at a tricky node permission question I'd like some help on. Using Drupal 5.x.
I have a series of Organic Groups, with a node type of "Board". Each Board is owned by uid 1, and has one or more other managers. I also have a number of other node types (for now let's say News and Page) defined. News, Page, and Board are both CCK-defined nodes, so they're owned by node.module.
What I want is to have OG manageres able to create Page nodes only in their own OG, not in any others. I also want to have anyone who is a subscriber of a given OG to be able to create a News node in that OG, or better yet be able to create a News node without even being a subscriber of that OG (optional bonus).
The roles system doesn't know from OG, so if I put managers into a "Manager" role then they'd be able to create Page nodes in any OG. I considered hook_access(), but that works only for nodes I've defined within that module. I glanced at hook_node_grants, but since I'm using OG already I'm quite worried to avoid getting into that mess if I can avoid it (since they both interact with the node_access table.
Does anyone have a better suggestion for how to make that work? I'm perfectly happy with a code-based solution so if "write this bunch of code" is the answer, I'm cool with that, but of course the less code I write the fewer bugs I can write, too. :-)
Larry Garfield a ecrit le 13/05/2007 04:07:
I considered hook_access(), but that works only for nodes I've defined within that module.
I think http://drupal.org/node/143075 and http://drupal.org/node/21613 are exactly about that
On Saturday 12 May 2007, Yves Chedemois wrote:
Larry Garfield a ecrit le 13/05/2007 04:07:
I considered hook_access(), but that works only for nodes I've defined within that module.
I think http://drupal.org/node/143075 and http://drupal.org/node/21613 are exactly about that
Yeah, switching to a full access hook in D6 would make this a lot easier. Unfortunately my target release date is before I expect D6 to ship, and there's no guarantee that patch will make it in to D6 anyway. I am therefore looking for a Drupal 5-compatible solution.
But yes, this is a textbook case where http://drupal.org/node/143075 is needed. :-)