Hi,
I'm trying to figure out how to restrict part of the node content to members of the organic (OG) group to which the node belongs. Here are two use cases to illustrate my problem:
1. An organic group may announce an event to the public. However, only members of that group are allowed to view the phone number of the event organizer.
2. A node has been created for each contact person of an organic group containing the name and picture of that person. (Note, not all contact persons are users.) Once again, only the group members are allowed to view pesonal contact information, such as phone number, etc.
My first idea was to create a CCK text area field just below the node body where group members posting into the group can enter private information. But I cannot figure out how to make the CCK permissions aware of the OG group. As a workaround, I could create a CCK field and a user role for each group that has private information. But since there are many such groups on the site, and new ones can be created by the users, that's not really a viable option.
Me next idea was to always hide the content of the CCK field and instead display it in a block where I use PHP to restrict the block visibility to group members only. But that doesn't really seem like an elegant solution.
Does anyone have a better idea? Or know how to make CCK group-aware?
Thanks in advance
Comments
I would tend to do this at the site level
I would tend to restrict privacy at the site level, rather than the group level. You can put personal information like phone numbers in the user's profile, and restrict profile access to site members only. It seems to me that the site is one community, and you are either in the community or you are not. If you want fine control over privacy at the group level, maybe you need a separate Drupal site for each group? You could use multi-site so each group shares the same code base, and there are ways to share user profiles across multiple Drupal sites. Having a separate Drupal site for each group will give you most control over privacy at the group level.