I am not sure if I shouldn't be logging this request against the og module, but since the problem is about listing issues, I thought I'll start here. My problem is that issues created by one group is being shown to members of other groups. I am assuming this is by design (judging from the way drupal issues work). How can I modify the module to only show issues for each group and not allow group subscribers to see another group's issues? I tried to use access control, only allowing group users to 'access own project issues', but users from one group are seeing issues created by users from another group so it doesn't seem to matter that 'access project issues' is set to false for all group users except administrators.
I started out thinking the query within the function project_issue_query_sql() in issue.inc (line 1861) is what I need to modify. Using drupal_set_message, I was able to print out the query output from this function and this is what I got:
SELECT DISTINCT(n.nid) FROM {node} n INNER JOIN {project_issues} p ON p.nid = n.nid INNER JOIN {node_revisions} r ON r.vid = n.vid INNER JOIN {users} u ON p.assigned = u.uid INNER JOIN {node_access} na ON na.nid = n.nid WHERE (na.grant_view >= 1 AND ((na.gid = 0 AND na.realm = 'all') OR (na.gid = 0 AND na.realm = 'og_public') OR (na.gid = 21 AND na.realm = 'og_subscriber'))) AND ( n.status = 1 AND ((p.pid = '10')) AND ((p.sid = '1' OR p.sid = '8' OR p.sid = '13' OR p.sid = '14' OR p.sid = '2' OR p.sid = '4' OR p.sid = '7')))
SELECT COUNT( DISTINCT(n.nid)) FROM {node} n INNER JOIN {project_issues} p ON p.nid = n.nid INNER JOIN {node_revisions} r ON r.vid = n.vid INNER JOIN {users} u ON p.assigned = u.uid INNER JOIN {node_access} na ON na.nid = n.nid WHERE (na.grant_view >= 1 AND ((na.gid = 0 AND na.realm = 'all') OR (na.gid = 0 AND na.realm = 'og_public') OR (na.gid = 21 AND na.realm = 'og_subscriber'))) AND ( n.status = 1 AND ((p.pid = '10')) AND ((p.sid = '1' OR p.sid = '8' OR p.sid = '13' OR p.sid = '14' OR p.sid = '2' OR p.sid = '4' OR p.sid = '7')))
Could anyone see a way to modify this query to only show group content to group subscribers or is there an easier way to place this sort of restriction on project issues?
Thanks,
dantina.
Comments
Comment #1
daleeman commentedCheck out the OG Project Module.