Hide Export Options Plugin (Excel, PDF, and more)
- 7 Nov 18 - Updated for 7.2 and automatically removes download menu item when no viable download options are enabled.
-
In the current version, the effects are applied to all listed chart types for all non-whitelisted users.
-
Hi Nick,
I investigated the plugin on version 7.1 today and didn't notice any regression.
Would it be possible to provide more information?
Also, I would make sure that you check out the config.js file inside the plugin folder to make sure the defined behavior matches up with what you're expecting.
Best,
Jason
-
Hi Michele,
I feel like this could be a configuration issue, the supported roles option is a whitelist, not a blacklist.
So any role you specify in that array will be allowed to download. Any other role should be disabled.
If you'd like to attach this part of your config file, I'd be glad to take a look.
-
I am having same issue in 7.1+ Here is my configuration. When I log in as a viewer, can still download.
mod.hideExportSettings = {
supportedWidgets: ['indicator', 'chart/pie', 'chart/column', 'chart/bar', 'chart/line', 'chart/area', 'pivot', 'tablewidget', 'chart/scatter', 'treemap', 'heatmap', 'map/scatter', 'map/area', 'sunburst', 'chart/boxplot', 'chart/polar'], // only the charts listed here will be affected
searchTerms: ['pdf', 'excel','csv'], // these menu items will be hidden
supportedRoles: ['super','contributor'] // these roles are whitelisted: users with these permissions
// can still see and use widget menu exports
};Any help would be much appreciated
-
Hi Jeremy,
I think the main thing to consider is that this is a client-side solution, so it can't be fully depended on as a security layer.
If you have secure data, it's always best to take additional measures (such as applying data security rules) to protect your data.
Best, Jason
-
Hi Anjali,
Here is a dashboard script example of turning off csv + excel download option for every widget on a dashboard:
dashboard.on('beforewidgetmenu', function(w, args) {
for(var i=0; i<args.items.length; i++) {
if(args.items[i].caption === 'Download') {
for(var j=0; j<args.items[i].items.length; j++) {
try { //needed because of separator objects
if(args.items[i].items[j].command.title === 'dashboard.widget.commands.csv.title' || args.items[i].items[j].command.title === 'dashboard.widget.commands.excel.title') { //check csv/excel download
args.items[i].items.splice(j, 1);
}
}
catch {
//do nothing
}
}
}
}
});You can add an if statement into the code to limit for just pivot tables from here.
Hope this helps!
Best, Elliott
-
Hi All,
Glad to announce, we've developed a new plugin which enables one to determine which export options will be available per widget for viewer users, this can be selected/deselected from within the widget editor UI:
We have also developed a custom dashboard export plugin to provide the option to enable/disable the ability to export complete dashboards to PNG or PDF.
Contact us for a live demo!
Sisense Partner of the year 2019!
-
Jaime,
Can you elaborate why you wish to hide a custom widget?
Assuming that you wish to hide it and not remove it, you can do it with the below simple snippet:
widget.on('ready', (widget) => {$('widget[widgetid="' + widget.oid + '"]').hide();}Keep in mind that it would be better to do it on the dashboard level if the widget has a constant ID (as if you do it on the widget level, once it is hidden - you will be able to edit it only by turning it on via the JS console in your browser)Let me know if you have any further questions, we're always happy to help (:
Ravid
Please sign in to leave a comment.
Comments
26 comments