Hi,

I am currently use node gallery module with organic groups module. In my setup,

1) both node_gallery_gallery and node _gallery_image are standard group post.
2) there is a gallery (nid == 2) posted in my group, and is set to be NON-PUBLIC group post, which means only group members have access to it.
3) and within the gallery, there is a gallery_image (nid == 3)

Observation:

When I log in as a non-group-member, I do not have access to the gallery(node/3), but I have the access to the image within the gallery (node/3).

Any ideas why?

Thanks.

Comments

foredoc’s picture

1) I checked {og_access_post}, and found that:

when nid = 2, og_access_post.og_public = 0; (gallery is non-public)
when nid = 3, og_access_post.og_public = 1; (gallery image is public)

2) I checked: function node_gallery_inherit_group_settings(&$image), and found that:

$gallery_node = node_load($image->gid) does NOT load og_public correctly,
when og_public = 1, $gallery_node->og_public = 1;
when og_public = 0, $gallery_node->og_public = NULL;

3) I manually set $gallery_node->og_public = 0, and $image->og_public = 0, and
after uploading the image, the og_public = 1 for image node

foredoc’s picture

Status: Active » Needs review

4)
gallery image insert flow: og_access_nodeapi->node_gallery_nodeapi(node_gallery_inherit_group_settings)

The problem is:

og_access-nodeapi saves information for gallery_image in {og_access_post} before it inherits the gallery group settings

Solution:
in {system}, adjust the weights of og_access and node_gallery: weight( og_access ) > weight(node_gallery), so that, node_gallery_nodeapi will be called before og_access_nodeapi

foredoc’s picture

Status: Needs review » Needs work

solution in #2 ensures proper og_public value for gallery_image,

however, the problem: "non-group-member be able to access NON-PUBLIC gallery image within the group" still exists.

Need to check on this.

foredoc’s picture

Status: Needs work » Needs review

Made a mistake in #3, forgot to update previous gallery_image.

dddave’s picture

Status: Needs review » Active
Issue tags: +Organic Groups integration

"Needs review" implies a patch that can be reviewed. ;)

Also adding a tag to make it easier to get all OG issues.

foredoc’s picture

Thanks.

Does this require a patch or just some documentation?

There was another issue related to the weights of Organic groups module, and node gallery module, and the decision was made as following:

http://drupal.org/node/1225140#comment-4772406

dddave’s picture

Title: node gallery image accessibility issue with organic groups module? » Node Gallery image accessibility issue with organic groups module?
Component: Miscellaneous » Howto/FAQ/Example

What is the exact issue here? If I understand the problem correctly (it seems your OP contains a faulty node/3) your solution in #2 fixes the issue.

Is the problem in #3 an independent issue?

foredoc’s picture

#3 is not an issue, it is my mistake.

The issue is the og_public field in {og_access_post} only can be correctly inherited by gallery_image from gallery, if weight( og_access ) > weight(node_gallery)

And the fix is described in #2

Sorry for the confusion

dddave’s picture

Status: Active » Fixed

I am setting this to fixed. I don't think that we should patch this into NG core. For those needing this there is an easy workaround documented in #2. Correct?

foredoc’s picture

Yes

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