summaryrefslogtreecommitdiff
path: root/addons/auth_oauth/controllers/main.py
diff options
context:
space:
mode:
authorChristophe Simonis <chs@odoo.com>2017-10-20 19:27:04 +0200
committerChristophe Simonis <chs@odoo.com>2017-10-20 19:27:04 +0200
commit10128fa7e8c743e9c838743204fb8116bcdeefd6 (patch)
tree7ffbf2540d01f994886369bd551ea59f7e446040 /addons/auth_oauth/controllers/main.py
parent68bef91d733aaf8f08df5f3daf0821a4c59d4d87 (diff)
parentdc2a6c6cd2a281b7d9e5d33d8e37d2f6b15d7e78 (diff)
[MERGE] forward port branch saas-16 up to dc2a6c6cd2a
Diffstat (limited to 'addons/auth_oauth/controllers/main.py')
-rw-r--r--addons/auth_oauth/controllers/main.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/addons/auth_oauth/controllers/main.py b/addons/auth_oauth/controllers/main.py
index 0d09f1e68aa..e231cd0f6d0 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,))