[IMP] ir.attachment access right, use write mode of related object

For related models, check if we can write to the model, as linking
or unlinking attachments can be seen as an update to the model.

Courtesy of Vincent Vinet

Closes: #1035