From formatC'vt in #2552683-5: Issues that are closed for comments shouldn't allow for new ones via issue edit:

"make sure that a locked issue cannot be edited either" should be taken not by nodechanges module i think

/**
 * Implements hook_node_access().
 */
function drupalorg_node_access($node, $op, $account) {
  // If $node is a string, the node has not yet been created. We don't care
  // about that case.
  if (is_string($node)) {
    return NODE_ACCESS_IGNORE;
  }
  if ($op == 'update') {
    if ($node->comment == COMMENT_NODE_OPEN || user_access('administer nodes', $account)) {
      return NODE_ACCESS_ALLOW;
    }
    else {
      return NODE_ACCESS_DENY;
    }
  }
  return NODE_ACCESS_IGNORE;
}

I think this is best in project_issue module, with a check for project_issue_node_is_issue().

Comments

drumm created an issue. See original summary.

formatC'vt’s picture

Assigned: Unassigned » formatC'vt

i'm working on it

formatC'vt’s picture

Status: Active » Needs review
StatusFileSize
new836 bytes

done, patch attached.

drumm’s picture

Status: Needs review » Needs work

Looking at node_node_access(), the administer nodes permission isn't actually checked. I'll update this to match the update access checking there.

drumm’s picture

Nevermind, matching node_node_access() would of course make this override affect nothing.

formatC'vt’s picture

hm, i do some test on localhost and user without administer nodes permission can't edit issues with closed comments.

  • drumm committed 4b54121 on 7.x-2.x authored by formatC'vt
    Issue #2564039 by formatC'vt: Check COMMENT_NODE_OPEN on issue edit...
drumm’s picture

Status: Needs work » Fixed
Issue tags: +needs drupal.org deployment

Committed with a small change - only NODE_ACCESS_DENY is returned if applicable. In case there are multiple hook_node_access() implementations acting, a more-targetted implementation is more-likely to avoid conflicts. administer nodes is indeed a good permission to check for overrides.

drumm’s picture

Issue tags: -needs drupal.org deployment

Now deployed to Drupal.org.

Status: Fixed » Closed (fixed)

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