summaryrefslogtreecommitdiff
path: root/addons/web/static/src/js
diff options
context:
space:
mode:
authorMitali Patel <mpa@odoo.com>2020-02-12 14:09:12 +0000
committerXavier Morel <xmo@odoo.com>2020-04-01 13:07:50 +0000
commitc248594ee5255b232e42438783b9061d235153cb (patch)
treea436fcd46d9b2d55356cc1d2778f1c2b5971881a /addons/web/static/src/js
parent271112980941825a76af6488a19e12031c771b99 (diff)
[IMP] base: allow restricting / removing exports right
Add a new group allowing administrators to remove the ability for users to bulk-export data from the database. It's pretty minor as technically the user can still access the underlying object through the basic methods but it's still a bit of a roadblock. Users can export by default. Task 2170900 closes odoo/odoo#45400 Signed-off-by: Xavier Morel (xmo) <xmo@odoo.com>
Diffstat (limited to 'addons/web/static/src/js')
-rw-r--r--addons/web/static/src/js/views/list/list_controller.js14
1 files changed, 10 insertions, 4 deletions
diff --git a/addons/web/static/src/js/views/list/list_controller.js b/addons/web/static/src/js/views/list/list_controller.js
index 4a3972d50eb..988291fdb1e 100644
--- a/addons/web/static/src/js/views/list/list_controller.js
+++ b/addons/web/static/src/js/views/list/list_controller.js
@@ -58,6 +58,9 @@ var ListController = BasicController.extend({
this.fieldChangedPrevented = false;
this.isPageSelected = false; // true iff all records of the page are selected
this.isDomainSelected = false; // true iff the user selected all records matching the domain
+ session.user_has_group('base.group_allow_export').then(has_group => {
+ this.isExportEnable = has_group;
+ });
Object.defineProperty(this, 'mode', {
get: () => this.renderer.isEditable() ? 'edit' : 'readonly',
set: () => {},
@@ -372,10 +375,13 @@ var ListController = BasicController.extend({
return null;
}
const props = this._super(...arguments);
- const otherActionItems = [{
- description: _t("Export"),
- callback: () => this._onExportData(),
- }];
+ const otherActionItems = [];
+ if (this.isExportEnable) {
+ otherActionItems.push({
+ description: _t("Export"),
+ callback: () => this._onExportData()
+ });
+ }
if (this.archiveEnabled) {
otherActionItems.push({
description: _t("Archive"),