[FIX] fix the access rights verification in attachments

bzr revid: christophe@tinyerp.com-20081205115409-rlk3mq4fw89f1hue
This commit is contained in:
Christophe Simonis
2008-12-05 12:54:09 +01:00
parent 6f24369ba2
commit 3332f26cc2
+5 -6
View File
@@ -52,12 +52,11 @@ class ir_attachment(osv.osv):
cache = {}
ima = self.pool.get('ir.model.access')
for m in models:
if m['res_model'] in cache:
if not cache[m['res_model']]:
ids.remove(m['id'])
continue
cache[m['res_model']] = ima.check(cr, uid, m['res_model'], 'read',
raise_exception=False)
if m['res_model'] not in cache:
cache[m['res_model']] = ima.check(cr, uid, m['res_model'], 'read',
raise_exception=False)
if not cache[m['res_model']]:
ids.remove(m['id'])
if count:
return len(ids)