I have 2 groups and a test user who is subscribed to both groups BUT is only a 'content provider' for GroupA. If he logs on and goes to GroupA then there is the standard LH block
Create Page
Create Story etc..
Clicking on Create page - as expected opens a new blak page to add - so far so good. However clicking on GroupB also gives the standard LH block
Create Page
Create Story etc..
Clicking on Create page - gives... Access denied. and the LH block THEN updates itself NOT to show these content provider links.

Is there a way that it could check when the GroupB link is fist clicked and if the user is not a content provider for GroupB NOT to show these linkls in the first place.

Otherwise the only solution seems to be to create 10 content types eg StoryGroupA, StoryGroupB etc and then 10 seperate content providers linked just to the relevant content type. But not very elegant

any advice please

Comments

artatac’s picture

Also if the user Clicks 'Create (GroupA) page' and then in the reulting form goues to the Group section > unticks GroupA and Ticks GroupB. The story will appear in groupB even though the user has no permission to put it there...

somebodysysop’s picture

Also if the user Clicks 'Create (GroupA) page' and then in the reulting form goues to the Group section > unticks GroupA and Ticks GroupB. The story will appear in groupB even though the user has no permission to put it there...

This is an OG issue, discussed at length here: http://drupal.org/node/130601 and here: http://drupal.org/node/164070. OG developer says this is a feature by design.

If you want og_user_roles to handle it, then you'll need to deploy TAC/OG integration: http://drupal.org/node/163567

somebodysysop’s picture

I have 2 groups and a test user who is subscribed to both groups BUT is only a 'content provider' for GroupA. If he logs on and goes to GroupA then there is the standard LH block
Create Page
Create Story etc..

What is an LH block?

Clicking on Create page - as expected opens a new blak page to add - so far so good. However clicking on GroupB also gives the standard LH block
Create Page
Create Story etc..
Clicking on Create page - gives... Access denied. and the LH block THEN updates itself NOT to show these content provider links.

Definately sounds like a cache issue.

Is there a way that it could check when the GroupB link is fist clicked and if the user is not a content provider for GroupB NOT to show these linkls in the first place.

The reason you get the list of links in the first place is because OG has performed a node_access('create ', content_type) to determine each node type the user has access to.

// $group is an object containing the group node
function og_og_create_links($group) {
  $exempt = array_merge(variable_get('og_node_types', array('og')), variable_get('og_omitted', array()));
  foreach (node_get_types() as $type) {
    // we used to check for node_access(create) but then node admins would get a false positive and see node types that they could not create
    if (!in_array($type->type, $exempt) && module_invoke(node_get_types('module', $type), 'access', 'create', $type)) {
      $links[] = l(t('Create !type', array('!type' => $type->name)), "node/add/$type->type", array('title' => t('Add a new !s in this group.', array('!s' => $type->name))), "gids[]=$group->nid");
    }
  }
  return $links ? $links : array();
}

If nodes that the user does NOT have access to are appearing on the menu, my guess is it's because the user module is getting the permissions from cache.

Check out the section on "Caching" here: http://www.realjenius.com/node/537

What level of caching does your site have? Have you tried changing it to see what happens?

Also, is your og_user_roles module weighted heavier than your node and other modules? If not, try that also.

artatac’s picture

Thank you for a very detailed response I will try these ideas and report back. LH - means Left Hand (column of the web page)
REgards

Joe

somebodysysop’s picture

I assume you are referring to the Group menu, and not the main navigation menu. Correct?

somebodysysop’s picture

Assigned: Unassigned » somebodysysop
Status: Active » Postponed (maintainer needs more info)

If you are still having this problem, then I need more info. Otherwise, I'll close the issue.

There is a debug feature in release 2.1 that you can use to tell you what group context has been determined for every url a user visits. This may help in determining why a user has roles for group a when he is sitting at group b. http://drupal.org/node/164038

somebodysysop’s picture

f you don't already have it, download and install "Database Administration": http://www.drupal.org/project/dba.

Go to: Admin->Site Building->Database

Click on cache_page

See what urls are cached. See if one of those urls is the url to the Group Home Page in question.

If you do see it, then disable page caching (Admin->Site Configuration->Permformance) and see if you still have the problem.

somebodysysop’s picture

Status: Postponed (maintainer needs more info) » Closed (fixed)

No response from issue creator.