I'm using the OG module version 2.0 and a custom group member listing using views 2.
The listing is a page display in a sortable table style with the path groups/%/members where % is the nid of the group node. The view adds a Relationship with user Content Profile node, so that member listings turn the user name into a link to the user's public profile. There are additional Fields for other columns that show the listed user's Group roles and admin links to change the user's admin status or leave the group.
This listing view works great - so long as the user viewing the listing is a member of the group, or is a Drupal admin. Other authenticated users who are not members of the group, and anonymous users get a 404 page.
Under basic View settings Access is set to Unrestricted. Under Permissions I have granted "node: access content", "user: access user profiles" and "views: access all views" to every role - including anonymous users - and additional access to authenticated users.
I have no problem accessing the list of groups, and I have no problem accessing a very similar view that lists a particular content type belonging to that group. It only seems to have trouble with a listing of users, and I can't figure out why.
I can paste the exported view if that will help. Thanks!
Comments
It's definitely some kind of
It's definitely some kind of permissions thing. If I grant anonymous users "administer nodes" permissions then they can see the listing. Of course that's no solution. I tried granting various other permissions but nothing else had any effect.
I scanned through the OG module looking for a db_rewrite_sql hook that might be interfering but I couldn't find anything like that. Adding my own db_reqwite_sql hook to debug the queries that are triggered from the view shows that the queries on the user table that retreive the user list aren't even executed, so I can't try to fix it there.
I'm completely lost. I don't even know if the problem is with Views, OG or User. Looks like I might have to resort to skipping views altogether and write a custom query just like in the Drupal 5 days. Pity, I was starting to like Views 2 and OG :(
Whoops - my mistake. Found a
Whoops - my mistake. Found a hidden Views argument validation that was requiring the current user to be part of the group. Sorry!
where did you find it?
I am a little confused about this one, cant find said argument in views. mainly hoping to allow any user to view the group listing via the main /og page. Curious.
It is located here:
In the members view, select "Organic groups: Group node" under Arguments.
Validator options:
Uncheck "Validate current user is a member of a specified group"
That should to the trick.