[IMP] mail: check at least access_rights in case of creation

bzr revid: mat@openerp.com-20140206110327-zar4yl03r1lympx6
This commit is contained in:
Martin Trigaux 2014-02-06 12:03:27 +01:00
parent 7407f3c888
commit 922836d8cd
1 changed files with 5 additions and 5 deletions

View File

@ -1201,12 +1201,12 @@ class mail_thread(osv.AbstractModel):
user_pid = self.pool.get('res.users').browse(cr, uid, uid, context=context).partner_id.id
if set(partner_ids) == set([user_pid]):
if context.get('operation', '') != 'create':
try:
self.check_access_rights(cr, uid, 'read')
try:
self.check_access_rights(cr, uid, 'read')
if context.get('operation', '') != 'create':
self.check_access_rule(cr, uid, ids, 'read')
except (osv.except_osv, orm.except_orm):
return False
except (osv.except_osv, orm.except_orm):
return False
else:
self.check_access_rights(cr, uid, 'write')
self.check_access_rule(cr, uid, ids, 'write')