This module doesn't play well with organic groups. I have:

- OG group type == room
- OG group post == discussion

And if I enable this module, discussion node types are displayed to everyone even though the group is 'invite only' (i.e. the audience is a subset of a Drupal role). Disabling the module returns things to their intended functionality.

Comments

attiks’s picture

Same here :/

All post will become visible to any user, i hope to solve this but no luck so far

attiks

attiks’s picture

See http://drupal.org/node/266764 for more information, it's a bit complicated :/

kulfi’s picture

Thanks for that. The link to http://groups.drupal.org/node/5392 might prove useful, am off to investigate.

NewZeal’s picture

The reason that content access breaks OG permissions is that the default setting is for all content to be viewable by anonymous and authenticated users. When you configure multinode access with og OR content_rid content will ALWAYS show unless you make the content type or the node unchecked for the anonymous and authenticated roles. Any content types which are not activated for content access will take on the default values of anonymous and authenticated roles checked on and any og restrictions will be completely ignored. This feature is great for content access when used on its own because it means that all nodes are visible by default unless reconfigured through content access settings but it makes it less useful in a multinode access situation.

This is the function in content_access.module that defines the defaults:

/*
 * Defines default values for settings.
 */
function content_access_get_setting_defaults($setting, $type) {
  switch ($setting) {
    default:
      return array();
    case 'view':
      return array(DRUPAL_ANONYMOUS_RID, DRUPAL_AUTHENTICATED_RID);
    case 'delete':
    case 'update':
      $roles = content_access_get_permission_access('edit '. $type .' content');
      if (count(array_diff(array(DRUPAL_ANONYMOUS_RID, DRUPAL_AUTHENTICATED_RID), content_access_get_permission_access('edit own '. $type .' content'))) == 0) {
        $roles[] = 'author';
      }
      return $roles;
    case 'priority':
      return 0;
  }
}

replace return array(DRUPAL_ANONYMOUS_RID, DRUPAL_AUTHENTICATED_RID);
with return array();

to remove the default view access.

Having said that I found that content access works best without this hack and used in an AND relationship with organic groups. See: http://groups.drupal.org/node/5392#comment-58684

fago’s picture

also see http://drupal.org/node/341501

If this is a common use case, perhaps someone can write a guide for this?

fago’s picture

Status: Active » Closed (duplicate)
NewZeal’s picture

I wrote up instructions at: http://groups.drupal.org/node/5392#comment-58684 which I have maintained and will continue to do so. If there is sufficient interest I am happy to write it up in Drupal docs. So far the system is working well.