From 468598540f11602cdb46ecaaa1953c7eae33b7bc Mon Sep 17 00:00:00 2001 From: Shiben Dutta Date: Thu, 16 Jan 2020 17:22:50 +0530 Subject: [PATCH] fix: disable data export as per QMC --- src/index.js | 28 +++++++++++++++------------- 1 file changed, 15 insertions(+), 13 deletions(-) diff --git a/src/index.js b/src/index.js index 1c0505b..67a5a03 100644 --- a/src/index.js +++ b/src/index.js @@ -115,19 +115,21 @@ export default { return menu; } - menu.addItem({ - translation: 'Export as XLS', - tid: 'export-excel', - icon: 'export', - select: () => { - exportXLS( - this.$element, - this.$scope.layout.title, - this.$scope.layout.subtitle, - this.$scope.layout.footnote - ); - } - }); + if (typeof (this.backendApi.model.layout.qMeta.privileges[3]) !== 'undefined' && this.backendApi.model.layout.qMeta.privileges[3] === 'exportdata') { + menu.addItem({ + translation: 'Export as XLS', + tid: 'export-excel', + icon: 'export', + select: () => { + exportXLS( + this.$element, + this.$scope.layout.title, + this.$scope.layout.subtitle, + this.$scope.layout.footnote + ); + } + }); + } return menu; }, version: 1.0