New model

bzr revid: pinky-09dd53930360b01029256d2414ac925be1beb9d4
This commit is contained in:
pinky 2006-12-26 12:28:50 +00:00
parent 6ef58b43f5
commit 080b08b49a
1 changed files with 10 additions and 4 deletions

View File

@ -95,8 +95,14 @@ class ir_model_access(osv.osv):
if not cr.rowcount:
return True
# if group None, ok for this user
ids = filter(lambda x: x[1], cr.fetchall())
for i in ids:
if not i:
return True
# compute the list of groups which have the right we are looking for
ids = map(lambda x: str(x[0]), filter(lambda x: x[1], cr.fetchall()))
ids = map(lambda x: str(x[0]), ids)
if not ids:
raise osv.except_osv('Access denied !', 'You can not %s this resource !' % mode)
ids_str = ','.join(ids)