I've been staring at the code snippet below for 10 minutes now, and I just can't find a valid reason for the second call to user_access. So either I'm missing something (not unlikely :) ), or it can go.

/**
 * Implementation of hook_nodeapi_view().
 */
function upload_nodeapi_view($node, $teaser, $page) {
  if (isset($node->files) && user_access('view uploaded files')) {
    // Add the attachments list to node body with a heavy
    // weight to ensure they're below other elements
    if (count($node->files)) {
      if (!$teaser && user_access('view uploaded files')) {
        $node->content['files'] = array(
          '#markup' => theme('upload_attachments', $node->files),
          '#weight' => 50,
        );
      }
    }

    upload_nodeapi_links($node, $teaser);
  }
}
CommentFileSizeAuthor
upload-user-access.patch909 bytesmr.baileys
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Dries’s picture

Status: Needs review » Fixed

You're right, Mr. Baileys! Committed to CVS HEAD. Thanks.

Status: Fixed » Closed (fixed)

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