diff --git a/CHANGELOG b/CHANGELOG index f889751b05..515a0eb366 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,3 +1,4 @@ +* Add new configuration option to prevent database listing * Add warning to wizards * Add server-side icons * Add support for file link to BinaryField diff --git a/etc/trytond.conf b/etc/trytond.conf index 4d564cb406..90e74c0c97 100644 --- a/etc/trytond.conf +++ b/etc/trytond.conf @@ -87,3 +87,6 @@ # Enable auto-reload of modules if changed #auto_reload = True + +# Prevent database listing +#prevent_dblist = False diff --git a/trytond/config.py b/trytond/config.py index 02e5fa23c9..55e95b4eaa 100644 --- a/trytond/config.py +++ b/trytond/config.py @@ -49,6 +49,7 @@ class ConfigManager(object): 'session_timeout': 600, 'psyco': False, 'auto_reload': True, + 'prevent_dblist': False, 'init': {}, 'update': {}, } diff --git a/trytond/protocols/dispatcher.py b/trytond/protocols/dispatcher.py index d78cadfda8..acc49c98c8 100644 --- a/trytond/protocols/dispatcher.py +++ b/trytond/protocols/dispatcher.py @@ -69,6 +69,8 @@ def dispatch(host, port, protocol, database_name, user, session, object_type, except Exception: return False elif method == 'list': + if CONFIG['prevent_dblist']: + raise Exception('AccessDenied') database = Database().connect() try: cursor = database.cursor()