I think the files attached to a node should respect the access rules applied to the node. Currently Attachments just provides files to anyone who asks for them.

CommentFileSizeAuthor
attachment.access.patch586 bytesstarbow

Comments

keve’s picture

Regarding patch above:
$nid = db_result( db_query( "select nid from {attachment} where {attachment}.fid = %d", $file->fid ) );

Can it happen that a 'fid' belongs to more nodes?

ccourtne’s picture

No no through the attachments table.. Attachments are designed to belong to one and only one node. There have been requests in the past to allow sharing that would be a completley separate design and module.

keve’s picture

Thanks.
+1 for above patch. I tested, it works fine for me.

ccourtne’s picture

Status: Needs review » Fixed

Applied. It will get checked in after me testing.

Anonymous’s picture

Status: Fixed » Closed (fixed)