We have content types A, B and C, behaving like groups.
We have content type AA,BB behaving like group content.

I expected to use that "Target Bundles" box so that only A-type nodes could be selected as Audience for a new AA-type node and B-type nodes could be selected as Audience for a new BB-type.

The user who have access to create A content type should not get the permission to create BB content type and also the user who have access to create B content type should not get the permission to create AA content type.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

jastraat’s picture

This should be possible already, but you would need to use two different entityreference fields with separate target bundle configuration.

reynosoreyesmiguel’s picture

Hi.
I have exactly same situation. When i try to add two different entity references for my two og group content types i get the error :

FieldValidationException: Errores de validación de campo en OgBehaviorHandler->validate() (línea 295 de /srv/httpd/sites/portal/sites/all/modules/og/plugins/entityreference/behavior/OgBehaviorHandler.class.php).

Attach the configuration for two fields.

ttronslien’s picture

@reynosoreyesmiguel I think your issue is solved in the following issue: FieldValidationException: error when saving entity og reference fields

ttronslien’s picture

It's not clear here "if the user who has access to create..." is granted access based on a regular Drupal role or the user's association with the group. Have you tried the module Organic Groups Create Permissions

This module provides the following key features:

Users can no longer create content in groups they are not active members of
Provides a new group level "Create" permission

ttronslien’s picture

Category: Feature request » Support request
jastraat’s picture

I don't believe OG create permissions is compatible with the 7.x-2.x version of OG which already has built in create permissions.

The roles that determine create access can be either the Drupal role or the user's role in the group. It depends on if you've enabled 'strict' permissions in the OG settings. When 'strict' permissions are enabled, users need to either have access granted by their group membership role or have full 'administer og permissions' at the Drupal role level.

ttronslien’s picture

You were right about the built in.

So maybe I am not understanding what you are getting at, but here is what I did

Created Content Type Group A, B, and C
Created Content Type AA, and BB with Group relations to the respective Group Content Types
Created Group A and Group B of the respective Content Type
For the fun of it, I added a new role on drupal level (Contributor) and one of each of the respective Groups (Contributors)
Configured such that Contributors in Type Group A can add, edit, delete content type AA, did the Same for Group B. (Screenshot attached)
Created dummy userA and dummy userB.
Assigned user to their respective Groups, giving them contributor role
Enabled og_extras and placed the content block in a visible region (I found this to be helpful http://makandracards.com/jan0sch/11463-drupal-organic-groups-extras-add-...)
and when I log in as userB, I get Create Content BB
and I log in as userA, I get Create Content AA (Screen shot attached)

I hope this helps, and if I am off the charts in the wrong direction, please tell me so.

reynosoreyesmiguel’s picture

@ttronslien, the link #4 solved my validation issue. Thanks