[IMP] orm: do not use xpath for hidding buttons when user hasn't the right role

bzr revid: christophe@taupe-20090304230057-tx2ch1yfmbk0b1gb
This commit is contained in:
Christophe Simonis
2009-03-05 00:00:57 +01:00
parent 7811b928fd
commit 1d8d7b7236
+1 -1
View File
@@ -872,7 +872,7 @@ class orm_template(object):
rolesobj = self.pool.get('res.roles')
usersobj = self.pool.get('res.users')
buttons = xpath.Evaluate("//button[@type != 'object']", node)
buttons = (n for n in node.getElementsByTagName('button') if n.getAttribute('type') != 'object')
for button in buttons:
ok = True
if user != 1: # admin user has all roles