1

We are using Organic groups and Panels with Drupal 7.

We want each group to have one panel node (that is, a node which content type is "Panel"). The group administrator can then use different kind of layouts and display existing content.

I created two groups A and B. I also created panel node (a node which content type is "Panel") for each group and some nodes that belong to group A and some nodes that belong to group B

Now, when admin of group A edits the panel node's content (through a tab "Panel content") of group A and selects Existing node when adding content to a panel pane, he can choose nodes that belong to group B. Is there a way to make panels respect OG access control? So that group A admin could not select contents of group B to be displayed in a panel pane of group A.

The content in the groups still need to be public so that if anonymous user visits content belonging to each group he will be able to see them.

1

I guess that by:

when admin of group A edits the panel page

you mean edit the group's node that is being viewed through a panel,and not that he can edit the panel's settings, and when you're saying

selects Existing node when adding content to a panel pane

you mean that selects content through field (entity-reference). That said, you don't need to make panels respect OG permissions -I am not sure if that's possible- but to filter out the content showing in that field based on Group A or B. To achieve that you may use field_get_items, see the contents of the field and check which node belongs to which group (every node belonging to a group has a Group id (gid) by that gid you can node_load the group node and access its fields) and configure set/unset the field's values accordingly or even you may use hook_form_alter to do so.

  • Thank you for your answer but that was not quite what I meant. By "when admin of group A edits the panel page" I mean modifying a node, which content type is panel and which has for example tabs "view", "edit", "panel layout" and "panel content". And modifying here happens by using the "panel content tab" to add existing nodes to be shown when this panel node is viewed. I also tried to clarify my original question. – jjei Dec 22 '15 at 18:15

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.