How to hide the "Switch to view mode" button based on a role
How to hide the "Switch to view mode" button based on a role
How to use it?
The code snippet:
dashboard.on('initialized', () => {
if (prism.user.baseRoleName === 'contributor') {
$('button.btn--switch-mode').remove()
}
})
After that, please save the changes and refresh the dashboard page. Hope this helps!
Disclaimer: Please note, that this blog post contains one possible custom workaround solution for users with similar use cases. We cannot guarantee that the custom code solution described in this post will work in every scenario or with every Sisense software version. As such, we strongly advise users to test solutions in their own environment prior to deploying them to ensure that the solutions proffered function as desired in their environment. For the avoidance of doubt, the content of this blog post is provided to you “as-is” and without warranty of any kind, express, implied or otherwise, including without limitation any warranty of security and or fitness for a particular purpose. The workaround solution described in this post incorporates custom coding which is outside the Sisense product development environment and is therefore not covered by not covered by Sisense warranty and support services.