bzr revid: christophe@tinyerp.com-20081017100550-22lqibto3fa7ajgx
This commit is contained in:
Christophe Simonis 2008-10-17 12:05:50 +02:00
parent aa4bca4cf8
commit 854b48096f
1 changed files with 8 additions and 0 deletions

View File

@ -294,6 +294,14 @@ class ir_model_access(osv.osv):
" WHERE m.model = %s AND a.group_id = %d", (model_name, group_id)
)
r = cr.fetchone()
if r is None:
cr.execute("SELECT perm_" + mode + " "
" FROM ir_model_access a "
" JOIN ir_model m ON (m.id = a.model_id) "
" WHERE m.model = %s AND a.group_id IS NULL", (model_name, )
)
r = cr.fetchone()
return bool(r and r[0])
def check(self, cr, uid, model, mode='read', raise_exception=True):