By molenick on
I'm trying to build a view of public and private organic groups on my site that is accessible by all (anon too) users. Somewhere in the chain between Views, OG and core access to group nodes are protected from view access to non-admin and non-super users.
I'm looking for the best way to alter this access to expose some of these private group nodes to anonymous users - basically, I'd like a view to be able to return the title, description and group logo without too much fuss, but I'm not sure where in Drupal's (and OG's) access code to make such an alteration.
Comments
.
If it is about viewing the nodes,
- Core drupal has only one permission: per role "access content", all or nothing.
- A view will show to a user whatever the user's roles allow. Using the same view, different users will see different things. It doesn't set any permissions itself.
So, there is only one place to check, OG's permissions.
- Edit one problematic post and check if it has been posted to the right "audiences".
- If what you get doesn't feel right try the "Rebuild permissions" button in the post settings page (admin/content/node-settings).
I am assuming that you have no other access control module installed except OG. To be sure, check the node_access table in the database, the "realm" field, to see if any other modules are involved.
Thanks for your help, I took
Thanks for your help, I took another look at the node_access table and think I figured it out, at least within the context of my problem.
It looks like entering a new record for for a node/gid with a realm of all or og_public makes the node accessible to my node, unfortunately it also seems to remove most if not all of the private protections provided by og.
I am looking for something that will give me a little finer control - basically, I just need a private OG's title, description and a thumbnail of its logo to be returned in my view (alongside public ones). I might be able to settle for having the private group node publically accessible, but it exposes too much for my liking.
I wonder if there's another way to do this. My only other idea (that doesn't involve hacking something apart) is to use hook_nodeapi to create a public stub of group nodes, so that they're accessible regardless of og permissions. Still, this isn't quite ideal as I'd be storing a bunch of redundant info and I'd have the headache of needing to update stubs when group nodes are updated...
.
There is http://drupal.org/project/premium but I doubt it will get along well with og.