It seems like the function og_node_create_links() should be using og_user_access() to check permissions instead of just node_access(). The problem I'm seeing is that calling og_node_create_links() to display links in a block and then displaying the block on a group page. Ideally the links will only contain the content types that the user has permission to create in the context of the group currently being viewed.
I've attached a patch that fixes this for my use case however I'm not entirely sure what other ramifications it might have.
Related: #1600910: Create Content Block showing to none group members
Comment | File | Size | Author |
---|---|---|---|
#3 | og-node-create-links.patch | 566 bytes | Jax |
#2 | og-create_links_permissions.patch | 1003 bytes | Jax |
og-create_links_permissions.patch | 1003 bytes | eojthebrave | |
Comments
Comment #1
amitaibuThe perm name should be
og_user_access($group_type, $gid, "create $node_type content")
+ How about a small test ? :)
Comment #2
Jax CreditAttribution: Jax commentedUpdated patch with correct permission. Test still missing.
Comment #3
Jax CreditAttribution: Jax commentedOoops. This is the correct patch.
Comment #4
eojthebraveThe patch here fixes the following issues w/ the og_extras module.
#1600910: Create Content Block showing to none group members
#1791278: Question regarding the create content block
Comment #5
amitaibuCommitted, thanks.