I created a role for OG Promote to use, and gave the role, via Access Control, access to certain content that Registered users do not have. The role is assigned correctly, but the user is not able to create the specified content, nor are the role-sensitive menu items all appearing.

Example, I created a master group which users must join if they wish to be able to create their own groups. The role has the Access Control value to "Create Groups" under OG_Basic. When a user joins the master group, they are indeed assigned to the role I created. But, the Content>Create Content>Groups is not visible, even though the menu option is enabled. And if I click Create Content, then click Group from the node/add page, they get a "not allowed" error message.

CommentFileSizeAuthor
#4 og_promote_1.patch585 bytesdarren oh

Comments

kmillecam’s picture

I can repro this.

When my users join a group they are automatically promoted to a role that has rights to create a certain content type. The problem is, when the user clicks "create content" and then the content type, they get an error.

After the user logs out and back in, they can create the specified content.

Any suggestions would be appreciated.

Kevin

bwynants’s picture

most likely caching related....after setting the role menu's cache should be flused?

add cache_clear_all("menu:".$user->uid.":", true); where group is added and removed. see if it helps.

bwynants’s picture

 user_save($user, $edit);

should become

  user_save($user, $edit);
  // Delete that user's menu cache.
  cache_clear_all('menu:'. $user->uid, TRUE);

2 times in the code.....

darren oh’s picture

Status: Active » Needs review
StatusFileSize
new585 bytes

Here's a patch.

darren oh’s picture

Status: Needs review » Fixed

Fixed in CVS commit 46285.

Anonymous’s picture

Status: Fixed » Closed (fixed)