Closed (fixed)
Project:
Drupal core
Version:
7.x-dev
Component:
upload.module
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Reporter:
Created:
20 Feb 2009 at 08:28 UTC
Updated:
6 Mar 2009 at 10:30 UTC
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);
}
}
| Comment | File | Size | Author |
|---|---|---|---|
| upload-user-access.patch | 909 bytes | mr.baileys |
Comments
Comment #1
dries commentedYou're right, Mr. Baileys! Committed to CVS HEAD. Thanks.