Promotion to a role doesn't grant the role's access

Steel Rat - August 22, 2006 - 19:04
Project:OG promote
Version:4.7.x-1.x-dev
Component:Code
Category:bug report
Priority:normal
Assigned:Unassigned
Status:closed
Description

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.

#1

kmillecam - September 8, 2006 - 03:17

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

#2

bwynants - October 4, 2006 - 10:10

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.

#3

bwynants - October 4, 2006 - 10:59

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.....

#4

Darren Oh - November 24, 2006 - 03:25
Status:active» needs review

Here's a patch.

AttachmentSize
og_promote_1.patch 585 bytes

#5

Darren Oh - November 24, 2006 - 14:50
Status:needs review» fixed

Fixed in CVS commit 46285.

#6

Anonymous - December 8, 2006 - 15:00
Status:fixed» closed
 
 

Drupal is a registered trademark of Dries Buytaert.