[REVERT] Undo r.4617, introduced a bug in menu hierarchy retrieval
authorOlivier Dony <odo@openerp.com>
Wed, 12 Dec 2012 21:00:27 +0000 (22:00 +0100)
committerOlivier Dony <odo@openerp.com>
Wed, 12 Dec 2012 21:00:27 +0000 (22:00 +0100)
Browsing the menu data as super-user is not correct
because when we load the children menu the ORM
recursively calls menu.search(), this time as
admin, hence the groups of the admin are applied
or submenus, instead of the groups of the user.
The patch was also un-necessary, so there is no
reason to keep it.

r.4617 = chs@openerp.com-20121129172145-0ionmbffc72hwxoa

bzr revid: odo@openerp.com-20121212210027-i5yn1uyzmfho0jh0

openerp/addons/base/ir/ir_ui_menu.py

index 80e0845..a1f7580 100644 (file)
@@ -66,7 +66,7 @@ class ir_ui_menu(osv.osv):
             modelaccess = self.pool.get('ir.model.access')
             user_groups = set(self.pool.get('res.users').read(cr, SUPERUSER_ID, uid, ['groups_id'])['groups_id'])
             result = []
-            for menu in self.browse(cr, SUPERUSER_ID, ids, context=context):
+            for menu in self.browse(cr, uid, ids, context=context):
                 # this key works because user access rights are all based on user's groups (cfr ir_model_access.check)
                 key = (cr.dbname, menu.id, tuple(user_groups))
                 if key in self._cache: