summaryrefslogtreecommitdiff
path: root/addons/web/models/ir_http.py
diff options
context:
space:
mode:
authorSimon Lejeune <sle@openerp.com>2016-07-20 12:23:58 +0200
committerSimon Lejeune <sle@openerp.com>2016-07-20 14:16:01 +0200
commitd1cd293ecefde56bf649aa69b5da808755f6a4b8 (patch)
treed5a133b37f617b5407e8c02025ca58e5bc1cf14d /addons/web/models/ir_http.py
parent6ef1644a7b3812f4cc0d066ea74970791a4b4d54 (diff)
[FIX] web: session_info: introduce `is_superuser` key
This is done in order to enable the tour service only for the superuser. Commit 6ef1644a7b3812 changed the meaning of `is_admin` to achieve this but broke the fact that some features of the debug manager are available to admin and not only to the superuser. Anyway a `is_admin` key should mean that the user is in the admin group. We could have checked client side that the uid is equal to 1 but adding a `is_superuser` key is more elegant and easier to grep. Also fix the only occurence of a uid check in the weblcient. This reverts commit 6ef1644a7b3812f4cc0d066ea74970791a4b4d54.
Diffstat (limited to 'addons/web/models/ir_http.py')
-rw-r--r--addons/web/models/ir_http.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/addons/web/models/ir_http.py b/addons/web/models/ir_http.py
index 2b4b7509b52..0c3aacc09c9 100644
--- a/addons/web/models/ir_http.py
+++ b/addons/web/models/ir_http.py
@@ -21,7 +21,8 @@ class Http(models.AbstractModel):
return {
"session_id": request.session_id,
"uid": request.session.uid,
- "is_admin": request.env.uid == openerp.SUPERUSER_ID,
+ "is_admin": request.env.user.has_group('base.group_system'),
+ "is_superuser": request.env.user._is_superuser(),
"user_context": request.session.get_context() if request.session.uid else {},
"db": request.session.db,
"server_version": version_info.get('server_version'),