My specific problem: I'm using EVA to attach a view to a node, and then Views Data Export to attach a download link to that view. I want to give the download link a url like "node/%/mycsv.csv", and have this path be protected same as the node. More generally, shouldn't all paths following 'node/nid' (besides the admin ones like /edit and /delete) be protected exactly as the node page itself is?

In protected_node.module, I find this code:

    elseif (($param2 == 'done' && module_exists('webform')) || ($param2 == 'mid' && module_exists('nodesymlinks')) || ($param2 == 'register' && module_exists('registration'))) {
      $nid = protected_node_is_locked(arg(1), 'view');
    }
    else {
      // Any access right?
      $nid = protected_node_is_locked(arg(1));
    }

Why do we have to in effect whitelist the parameter following nid to not get Access Denied? I don't understand the parameters being passed to protected_node_is_locked.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

digitgopher created an issue. See original summary.

Grimreaper’s picture

Hello digitgopher,

I also think that whitelisting is not a sustainable way to do that. If you want to provide this easy patch, I will merged it.

About the parameters passed to protected_node_is_locked, arg(1), is the node_id is we are on a page like node/123. and the second parameter is the operation, 'view', 'edit', 'delete'

digitgopher’s picture

Category: Support request » Bug report
Status: Active » Needs review
FileSize
1.09 KB

Ok, this is what makes sense to me.

Is it what you had in mind?

  • Grimreaper committed c4be43b on 7.x-1.x authored by digitgopher
    Issue #2555557 by digitgopher, Grimreaper: Allow to protect entire node...
Grimreaper’s picture

Status: Needs review » Fixed

Exactly. Thanks this is merged now.

Status: Fixed » Closed (fixed)

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