It looks like users are being assigned the group join role when they request a subscription, but before the subscription is approved in groups that require sub approval.

I experimented by using a test user, joining a moderated group, and as soon as the test user requested a subscription the previously hidden group content appeared. If I disable the OG_User_Roles the same user who is awaiting subscription can no longer see the group content that is not public. I think you might just be missing a flag check in there somewhere.

The only access control modules I'm using are Drupal core, OG, OG_User_Roles, and Nodeaccess

Comments

somebodysysop’s picture

Not sure how to address this issue. Looked into it and right now og_user_roles assigns the user the role in hook_og at "user insert". Where else should this occur?

Steel Rat’s picture

Beats me. Does user insert occur when a sub is requested? Or when approved?

somebodysysop’s picture

I *thought* it was when it is approved. The only options for hook_og are:

'user insert', 'user update', 'user delete'

Steel Rat’s picture

Bummer. Is there any way to check if a user's subscription is pending or approved, and act or not act upon that?

somebodysysop’s picture

Assigned: Unassigned » somebodysysop
Status: Active » Needs review
StatusFileSize
new8.37 KB

In the og_uid table, there is a column "is_active". Apparently, this is "0" if the user is in moderation, or "1" if the user's membership has been approved.

The thing which tripped me up is that there is no way for an admin to actually place a user in moderation. The user is automatically placed in this category if he subscribes to a moderated group.

Anyway, try the attached patch against a clean version of the 2.5 release. See if it does the trick.

Steel Rat’s picture

I haven't had much luck running patches, I'll try to edit manually.

Steel Rat’s picture

Looks like that fixed it!

Thanks again for making the module which made my Role-playing site possible, and for the best support of any module so far!

Steel Rat

somebodysysop’s picture

Status: Needs review » Reviewed & tested by the community

You're welcome!

somebodysysop’s picture

Status: Reviewed & tested by the community » Fixed

Commited changes to release OGR release 2.6.

Anonymous’s picture

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for two weeks with no activity.