The oa_core_node_access() function denies users from creating nodes that have a group audience field on them. It denies every type but 'oa_space' (aka OA_SPACE_TYPE). This makes it check on content rather then for the field itself.

http://cgit.drupalcode.org/oa_core/tree/includes/oa_core.access.inc?id=c...

This patch uses og_is_group_type() http://www.drupalcontrib.org/api/drupal/contributions!og!og.module/funct... instead.

We were getting "Access Denied" when creating a content piece that had a Group Audience Ref field associated with it.

CommentFileSizeAuthor
oa_core_node_access.patch746 bytesrobloach

Comments

RobLoach created an issue. See original summary.

robloach’s picture

Issue summary: View changes
bobbygryzynger’s picture

I am experiencing a similar issue. The way that I would expect this to work is that group members with appropriate access privileges within their group should be able to create group content regardless of space context.

mpotter’s picture

No, this patch is not correct.

The og_is_group_content_type() is there to handle "create" access to any group-content (like events, discussions, etc). You don't want to get rid of that. If you want to check any group type instead of just OA_SPACE then you'd replace the OA_SPACE check with og_is_group_type(). I think you replaced the wrong part of the conditional with og_is_group_type().

The comment in #3 is a bit different. Yes, your permission in the Group will take affect, but only if that Group is a parent (or otherwise inherited parent) of the Space. If you are in a Group that allows you to create Spaces, you can't create a space anywhere on the site. You can only create spaces within other spaces that your Group is a parent of. That's by design.

If you want to give users access to create a space anywhere, put them into a top-level Group that is the parent of the home space (top space) of the site.

Argus’s picture

Status: Needs review » Needs work