diff options
| author | Christophe Simonis <chs@odoo.com> | 2017-10-20 17:24:15 +0200 |
|---|---|---|
| committer | Christophe Simonis <chs@odoo.com> | 2017-10-20 17:24:15 +0200 |
| commit | bee0c11ef7fdd2f289b1b5d33bf4574e519d8fcf (patch) | |
| tree | f763f9a855c0ab0b02f944c88ff6713bbbe3f34f /addons/auth_oauth/controllers | |
| parent | 8096162beeed30debcb1c3945e7f9cee35710666 (diff) | |
| parent | f3ac68ed29a478b8f092a3bc8523df171312a636 (diff) | |
[MERGE] forward port branch saas-14 up to f3ac68ed29a
Diffstat (limited to 'addons/auth_oauth/controllers')
| -rw-r--r-- | addons/auth_oauth/controllers/main.py | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/addons/auth_oauth/controllers/main.py b/addons/auth_oauth/controllers/main.py index aa3f4e69b5c..a5a888f51a2 100644 --- a/addons/auth_oauth/controllers/main.py +++ b/addons/auth_oauth/controllers/main.py @@ -6,6 +6,7 @@ import logging import json +import werkzeug.urls import werkzeug.utils from werkzeug.exceptions import BadRequest @@ -148,7 +149,11 @@ class OAuthController(http.Controller): url = '/web#action=%s' % action elif menu: url = '/web#menu_id=%s' % menu - return login_and_redirect(*credentials, redirect_url=url) + resp = login_and_redirect(*credentials, redirect_url=url) + # Since /web is hardcoded, verify user has right to land on it + if werkzeug.urls.url_parse(resp.location).path == '/web' and not request.env.user.has_group('base.group_user'): + resp.location = '/' + return resp except AttributeError: # auth_signup is not installed _logger.error("auth_signup not installed on database %s: oauth sign up cancelled." % (dbname,)) |
