diff options
| author | Raphael Collet <rco@openerp.com> | 2016-11-22 12:04:09 +0100 |
|---|---|---|
| committer | Raphael Collet <rco@openerp.com> | 2017-01-03 16:52:49 +0100 |
| commit | d0ca2d115e8b40308e1ff83bf9e7cc874762fbff (patch) | |
| tree | bdad5e8c9019f14a0416c27612969ae4932519b1 /addons/web/controllers/main.py | |
| parent | 7543afb0704d624f7abe6a2450a9d7e4a75e158b (diff) | |
[REF] ir_config_parameter: remove `group_ids` and simplify
Add `sudo()` to call `get_param` where necessary, and make the web client use a
controller instead of directly accessing parameters.
Diffstat (limited to 'addons/web/controllers/main.py')
| -rw-r--r-- | addons/web/controllers/main.py | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/addons/web/controllers/main.py b/addons/web/controllers/main.py index b1d5c732a13..930a8233eb5 100644 --- a/addons/web/controllers/main.py +++ b/addons/web/controllers/main.py @@ -18,6 +18,7 @@ import os import re import sys import time +import werkzeug import werkzeug.utils import werkzeug.wrappers import zlib @@ -777,6 +778,17 @@ class Session(http.Controller): request.session.check_security() return None + @http.route('/web/session/account', type='json', auth="user") + def account(self): + ICP = request.env['ir.config_parameter'].sudo() + params = { + 'response_type': 'token', + 'client_id': ICP.get_param('database.uuid') or '', + 'state': json.dumps({'d': request.db, 'u': ICP.get_param('web.base.url')}), + 'scope': 'userinfo', + } + return 'https://accounts.odoo.com/oauth2/auth?' + werkzeug.url_encode(params) + @http.route('/web/session/destroy', type='json', auth="user") def destroy(self): request.session.logout() |
