[FIX] ir.attachment: search() must filter out all records that are not accessible
[FIX] ir.attachment: search() must filter out all records that are not accessible

Due to the way ir.attachment permissions depend on the permissions of the
document they are attached too, normal filtering rules do not work for all
cases and a correct search() method is needed. This patch fixes some cases
that were not covered by search() yet.
An additional patch will be needed in the document module to also check
for access rights of the parent directory (a concept that does not exist
without the document module).

akretion/openerp-server,akretion/openerp-server,akretion/openerp-server