summaryrefslogtreecommitdiff
path: root/addons/web/controllers
diff options
context:
space:
mode:
authorOlivier Dony <odo@openerp.com>2017-10-03 12:34:50 +0200
committerOlivier Dony <odo@openerp.com>2017-10-03 12:46:03 +0200
commitb02dea768814f878bffe9ff1f42304a45d3189de (patch)
treed2cddec54814240c9c1e31493450f14d2aaa4d49 /addons/web/controllers
parent7d16769263b9cdefadb5059c04c0fc8892353c54 (diff)
[IMP] config: allow blocking access to db manager
- The `--no-database-list` option will now also block access to database management functions and screens. Presumably this flag should only be used in production when all databases have been provisioned, so the admin should like to block access to the db manager at the same time. - If no `--database` or `-d` parameter is provided, the system will be unable to fetch a list of databases at all, so users will be blocked with an error message. - Hide the link on the login screen to the DB manager when it is disabled, to prevent sending users to an error page. - Weak attempt at updating the documentation Note: the security check for RPC methods could have been done in the RPC dispatcher, however that would not have protected service methods when called directly, e.g. by a controller (e.g. the dump method).
Diffstat (limited to 'addons/web/controllers')
-rw-r--r--addons/web/controllers/main.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/addons/web/controllers/main.py b/addons/web/controllers/main.py
index cc2ef4201df..17ca031a48f 100644
--- a/addons/web/controllers/main.py
+++ b/addons/web/controllers/main.py
@@ -491,6 +491,9 @@ class Home(http.Controller):
if 'login' not in values and request.session.get('auth_login'):
values['login'] = request.session.get('auth_login')
+ if not odoo.tools.config['list_db']:
+ values['disable_database_manager'] = True
+
response = request.render('web.login', values)
response.headers['X-Frame-Options'] = 'DENY'
return response