diff options
| author | Simon Lejeune <sle@openerp.com> | 2016-07-19 16:59:53 +0200 |
|---|---|---|
| committer | Simon Lejeune <sle@openerp.com> | 2016-07-19 17:49:37 +0200 |
| commit | 6ef1644a7b3812f4cc0d066ea74970791a4b4d54 (patch) | |
| tree | d054dfa40bc8b4292345dea77d48a0052bad3ce9 /addons/web/models | |
| parent | 5bfcb697c4b834e52d3d11a784cd4d6de402b14a (diff) | |
[FIX] web: session_info: `is_admin` check
The tour mechanism displays a tour if the `session.is_admin` key
is set to True. For this key to bet set to True, you need to be
in the system group.
Default options adds the system group to any created user, however as
there aren't any ir.model.access rule defined on the `web_tour.tour`
model, when you try to login as this created user, you get a traceback.
As the only way to reach a `web_tour.tour` record is to have the
superuser_id, update the `is_admin` condition accordingly.
Diffstat (limited to 'addons/web/models')
| -rw-r--r-- | addons/web/models/ir_http.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/addons/web/models/ir_http.py b/addons/web/models/ir_http.py index 5e239bbb816..2b4b7509b52 100644 --- a/addons/web/models/ir_http.py +++ b/addons/web/models/ir_http.py @@ -21,7 +21,7 @@ class Http(models.AbstractModel): return { "session_id": request.session_id, "uid": request.session.uid, - "is_admin": request.env.user.has_group('base.group_system'), + "is_admin": request.env.uid == openerp.SUPERUSER_ID, "user_context": request.session.get_context() if request.session.uid else {}, "db": request.session.db, "server_version": version_info.get('server_version'), |
