Frage

Please don't ask why do i need to or why am I such a pervert.

I have an Organic Groups module on drupal 6. I need to add node_access hook to this module for some reason.

There is no preset node_access hook in "og.module" file or any file, connected to this module (i've checked this). I've tried adding "og_node_access" function with following body: "echo '1111111';return true;" and it doesn't trigger anywhere (no echoes at all). I've tried to add it to og.module file.

P.S.: Please do not reccomend any access expansions for OG - I have tried plenty of them. All I need is:(pseudocode)

    if ($op=='view'){
      if ($node->type == 'xxxx' || $node->type =='yyyyyyyy') {
          SHOW THIS TYPE OF NODES ONLY TO ADMIN(S) OF THE GROUP (OR SITE) AND THE AUTHOR OF THE NODE, NOBODY ELSE (EVEN IN THE SAME GROUP) IS ALLOWED TO SEE IT OR TOUCH IT.
      } else {
        USE DEFAULT RULES (return IGNORE);
      }
    } 

And I need it to be hardcoded, because Taxonomy access, Content Access and other "Acess" modules don't work properly (actually they don't work at all) with OG module.

P.P.S.: I know, that OG is kind of sht and there are a couple of alternatives, but i just need this to be done in a described way.

War es hilfreich?

Lösung

So... node_grants hook (I've mistyped in my comment it's "node_grants" not "access_grants") solved my problem. Unfortunately I've spent too much time (the whole day) googling and trying to understand a bit complicated grants system of drupal. Anyway thank you (all) for your answer(s).

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top