UID==1 -> acces a tout

bzr revid: pinky-709bc71552c791de4b2f83db87e776553c47da86
This commit is contained in:
pinky 2007-02-20 11:52:13 +00:00
parent e7b8739b1b
commit 3431f6d0b0
1 changed files with 2 additions and 0 deletions

View File

@ -88,6 +88,8 @@ class ir_model_access(osv.osv):
}
def check(self, cr, uid, model_name, mode='read'):
assert mode in ['read','write','create','unlink'], 'Invalid access mode for security'
if uid==1:
return True
# fetch the list of rules for this "permission type" on this model
cr.execute('select group_id, perm_'+mode+' from ir_model_access a left join ir_model m on (a.model_id=m.id) where m.model=%s', (model_name,))