Download & Extend

og_get_user_roles() returns inaccurate role list for group members

Project:Organic groups
Version:7.x-2.x-dev
Component:og.module
Category:bug report
Priority:normal
Assigned:Unassigned
Status:closed (fixed)

Issue Summary

og_get_user_roles() fails to match the desired gid to the og_user_roles table's gid field. So if a user is an "admin" of group A, but not an admin of group B, if you query their roles on group B (assuming they are a member of group B) it will incorrectly report they are an admin of group B, simply because that function hasn't bothered to filter the result set by gid.

I think all that needs to be done to fix this is add ->condition('ogur.gid', $gid, '=') to the $query object in og_get_user_roles().

Comments

#1

Status:active» fixed

Thanks, committed.

#2

Status:fixed» closed (fixed)

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

nobody click here