diff options
| author | Olivier Dony <odo@openerp.com> | 2017-01-27 11:39:10 +0100 |
|---|---|---|
| committer | Olivier Dony <odo@openerp.com> | 2017-01-27 13:56:05 +0100 |
| commit | 8235f03f565ecbb097aca94638703f5dd6ca4eea (patch) | |
| tree | fb7576fc6640d09aff71c36d5ba3ba2f9a74febd /odoo/addons/base/module/module.py | |
| parent | 59f43a777dfc60270d56968c477ddcae7a71a8af (diff) | |
[FIX] module: allow disabling 1-click install
As discussed on issue #15225, it should be possible for system administrators
to disable the 1-click installation system.
The plan is to disable the feature by default, but make it relatively easy
to turn on when it is explicitly desired.
1. At the moment we cannot guarantee that all Apps published on the Odoo Apps
Store are safe. And it is a security risk to let end-users deploy Python
code on their Odoo servers without requiring any review/deployment by a
competent system administrator.
We will work on improving the validation process of the Store, but this
will require time, and won't probably be a 100% safe process in any case.
2. The one-click install feature is however really useful to help
non-technical users install Apps, as long as the feature has been
explicitly allowed by the system administrator. This is a common feature
in other software suites as well. So we'd like to keep it as an opt-in
feature.
3. Administrators of multi-tenant servers, cloud hosting services, etc.
understandably expect to be able to turn off the feature for
security/control reasons.
4. By turning off the feature by default, but still exposing it in the UI,
we keep it *discoverable* for users. The error message should be
helpful to direct users to their sysadmins.
5. By using the permissions of the download folder as a flag for turning
off the feature, we avoid introducing an extra server parameter.
The folder is still created (read-only) by default, for the sole purpose
of making it easier to locate.
Fixes #15225
Diffstat (limited to 'odoo/addons/base/module/module.py')
| -rw-r--r-- | odoo/addons/base/module/module.py | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/odoo/addons/base/module/module.py b/odoo/addons/base/module/module.py index 233d12cb370..4d3e859352b 100644 --- a/odoo/addons/base/module/module.py +++ b/odoo/addons/base/module/module.py @@ -643,6 +643,15 @@ class Module(models.Model): if not self.env.user.has_group('base.group_system'): raise AccessDenied() + # One-click install is opt-in - cfr Issue #15225 + ad_dir = tools.config.addons_data_dir + if not os.access(ad_dir, os.W_OK): + msg = (_("Automatic install of downloaded Apps is currently disabled.") + "\n\n" + + _("To enable it, make sure this directory exists and is writable on the server:") + + "\n%s" % ad_dir) + _logger.warning(msg) + raise UserError(msg) + apps_server = urlparse.urlparse(self.get_apps_server()) OPENERP = odoo.release.product_name.lower() |
