Hide/Show columns based on usernames
We are looking to take the logged in Username/Email in Sisenese and compare it against a list, then show/hide specific columns of (pivotcharts) based on the access list.
Below is our tentative plan, but we are hoping that there is a much better way to do this. Any Advice?
Access List - could be in Javascript array, or preferably maintained in a database that is pulled into an elasticube then fed via JS api
Column Identifier - is it possible to target data in a dashboard, including related columns in pivotcharts, based on the column name (ie: SALES_AREA_PLAN_AMOUNT) ?? if not then we may just target based off from the visual presentation column label match, and search thru dom to find the related 'fidx="4"' identifier and use to target all columns in widget to hide/show. We may also just manually hardcode the fidx column reference number.
Widget Identifier - we would likely just iterate through all of a certain type(s) of charts in the dashboard (such as pivotchart), else manually identify by id
Location for the script - current plan to but at dashboard level
-
Hi John,
We've launched many similar scripts and plugins so I have several suggestions from our experience:
- Access list, it depends who manage that list. Most straightforward approach would be to save it in a global configuration dictionary within the plugin's code. If the person who manages that is completely not technical then a Google sheet or a csv file on the server would be the next best option. Search for the autoFilter plugin for some code samples on how to query the cube for configurations.
- Column Identifier, if not critical, I would strongly advice to simply use column index instead of using their names. Less elegant and robust but it would be much more stable.
- Widget Identifier, I highly suggest using the configuration based on widgets IDs(oid, the same one is in the URL). It would be the most straight forward to implement and most stable. Especially if you will sue the column index instead of column names.
- Location for the script - make it a Sisense plugin. It is really not much overhead to convert a dashboard script into a plugin and it would be a LOT easier to maintain, manage and debug.
Feel free to reach out if you want some help with it. That's our cup of tea (;
https://support.sisense.com/hc/en-us/community/posts/360001618833-Partner-Page-Paldi-Solutions
Please sign in to leave a comment.
Comments
2 comments