I'm on Drupal 7 with Organic Groups installed. I've created a Private Group 'Students' and a Private group 'IT-department' The groupmembers of 'Students' are all our students. The groupmembers of 'IT-department' are all the persons of the IT-departement.

When i create content and select as groups audience 'Students' and 'IT-departement'. Then the content is visible for everyone who is member of the group 'Students' OR the group 'IT-department'. Is it possible to do a AND ? So that the content is only visible for who is a member of the group 'Students' AND the group 'IT-department' ?

Comments

Staler75’s picture

did you find a solution yet? looking at a sort of same situation

nelsonre’s picture

In order to do what you want, you're going to need to write a custom solution. I suggest you look at the og_access module, particularly the og_access_node_access_records, and og_access_node_grants functions to see how it current works, and what you can do about it. I think you're going to need to concatenate group ids to create a single grantid in order to do what you want. So instead of adding each group id that a post belongs to the grants array, you need to just add the concatenation of all the group ids that a post belongs to. That's how I would tackle it. Others might have better ideas.

I would also recommend you look at the docs for hook_access_node_records, and hook_access_node_grants.