[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.
This commit is contained in:
Simon Lejeune
2016-07-19 17:49:37 +02:00
parent 5bfcb697c4
commit 6ef1644a7b
+1 -1
View File
@@ -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'),