Clone Own Node Not Recognizing OG Context

snorkers - November 6, 2009 - 23:21
Project:Node clone
Version:6.x-1.0
Component:User interface
Category:bug report
Priority:normal
Assigned:Unassigned
Status:active
Description

Scenario:

I have an Event content type that most roles cannot create using the default /node/add/event operation. However, within Organic Groups, all Group Members can create an Event node to post within their Group. All authorized users have the permission granted to be able to clone their own nodes. Additionally, Group Members are automatically given a 'Group Member' role (using OG User Roles) which has the 'clone node' permission granted - effectively allowing them to clone any node within their OG.

Problem:

If a Group Member wants to clone an Event node that they have previously posted, they are greeted with a "Sorry %user, you don't have permission to view the page you've just tried to access. " error. So node_clone operation is discounting permissions for 'clone own nodes' and 'clone node'. However, if user 1 does the clone operation, the cloned node does copy the OG context across.

Solutions?

I appreciate that the problem is due to integration with OG/OGUR, but it seems that the 'Clone Own Node' permission still checks to see if a user has generic rights to create the content type and the user_access() function used by the node_clone module doesn't look at OG rights. Has anyone else looked into this - or should I be contemplating my first stab at a optional patch/new module to provide this check...?

Are there any thoughts on allowing the 'Clone Own Node' to optionally override the general access checks... making the assumption that creating the node in the first place means they are trusted... and such users should have the rights to reproduce their own nodes regardless...? (Or is that just a huge can of worms waiting to be opened?)

#1

pwolanin - November 8, 2009 - 01:21

dynamic permssions like this are a bit of an edge case - I think the clone module already offers a hook you could use to modify this behavior?

 
 

Drupal is a registered trademark of Dries Buytaert.