This section describes how to customize the permissions given to the Sisense user roles (designer and viewer), using Sisense’s REST API. At the bottom of the page, you can find a video tutorial demonstrating the following procedure.

A reminder about default roles

Sisense users are assigned one of the following default roles:

  • Administrators
  • Designers: Can create, design, edit and share dashboards.
  • Viewers: Can view, explore, drill down, and filter the dashboards that designers have shared with them.

Click here to learn more about each role type.

Note: The API uses a previous terminology for Designers and Viewers. When entering the role name into the operation parameters, use Contributor (for Designer), and Consumer (for Viewer).

Customizing roles

You can customize the three default roles with Sisense’s REST API, by defining which permissions to enable or disable for each role. For example, you can prevent a user from drilling into widgets, or exporting data to a csv file. On the other hand, you may want to let viewers change the widget type and format the style.

The following table lists all the actions that you can customize using the API. True and False indicate values that you can change. Never indicates values that you cannot change.

Dashboards

DashboardsAdminDesignerViewerDescription
createTrueTrueNeverCreate a new dashboard.
duplicateTrueTrueFalseDuplicate an existing dashboard.
toggle_edit_modeTrueTrueFalseSelect between Layout and View modes in the dashboard.
Layout mode is the default mode in which you can add new widgets and rearrange them on the dashboard.
In View mode, the dashboard cannot be rearranged or edited.
edit_scriptTrueTrueNeverEdit a dashboard using the Sisense JavaScript API.
export_dashTrueTrueNeverExport a dashboard as a .dash file that can be imported back into Sisense.
export_jpgTrueTrueTrueDownload a widget as an image in PNG format. The downloaded image represents the current view.
export_pdfTrueTrueTrueExport the dashboard to PDF format. The exported file includes the current view.
restoreTrueTrueTrueRevert changes made in the dashboard to the latest dashboard that was shared.
importTrueTrueNeverImport a .dash file into the Sisense Web Application.
select_paletteTrue TrueNeverChange the selected color palette.
Filters
createTrueTrueFalseCreate a new filter.
on_offTrueTrueTrueSwitch filters on or off.
toggle_expansionTrueTrueTrueEnable the expansion of filter settings to see more filter parameters.
modify_typeTrueTrueFalseInclude in the filter options 'Ranking' and 'Starred', in addition to 'List' and 'Text'.

 

Widgets

WidgetsAdminDesignerViewerDescription
createTrueTrueNeverCreate a new widget.
deleteTrueTrueNeverDelete a widget.
renameTrueTrueFalseRename a widget.
duplicateTrueTrueNeverDuplicate a widget.
edit_scriptTrueTrueNeverEdit a widget using the JavaScript API.
change_typeTrueTrueFalseChange the chart type.
export_csvTrueTrueTrueExport a widget's data to a CSV file.
export_pngTrueTrueTrueDownload a widget as an image in the PNG format. The downloaded image represents the current view.
modify_selection_modeTrueTrueFalseEnable the option to change the filter behavior between 'Slice' (only filtered items are included in the chart) and 'Highlight' (filters items are highlighted).
drill_to_anywhereTrue TrueTrueEnable the option to drill down into a filed to get an in-depth view of a selected value. If False, the user can only drill down with predefined drill hierarchies (if defined).
Items
reorderTrueTrueFalseReorder the fields and values in the data panel and their representation in the chart.
modify_typeTrueTrueNeverEnables the option to edit values and categories in the data panel.
on_offTrueTrueTrueEnable the option to turn fields on or off in the widget.
Filters
on_offTrueTrueFalseSwitch filters on or off.
toggle_expansionTrueTrueTrueEnable the expansion of filter settings to display more filter parameters.
modify_typeTrueTrueFalseInclude in the filter options 'Ranking' and 'Starred', in addition to 'List' and 'Text'.
use_starredTrueTrueFalseEnables the option to star (bookmark as favorite) a filter selection.

 

To change permissions for a user role:

  1. In the Sisense web app, click ADMIN at the top right of the screen, and then REST API in the left menu.
  2. Click REST API Reference to view the API documentation.

  1. Click on /roles to access the different API operations.
  2. Find the operation that you require (see examples below), and type in the required parameters in the operation. You can click on Model Schema to see and add example code for the parameters.
    When changing a permission for a role, you must use the Path parameter, which defines the permission you want to update and its relative path in the hierarchy that appears in the table above. For example, to change the ‘Create’ setting for dashboard filters, enter dashboards/filters/. For creating dashboards, enter /dashboards. See the reference table above for more settings.
  3. Click RUN to apply the changes.

Here are some examples of what you can do.

See all permissions for all roles

Method: Get /roles 

Parameters

  • includeManifest  – Use the default setting (true)
  • compiledRoles – Use the default setting (true)

Example API Call

/api/roles?includeManifest=true&compiledRoles=true

See all settings for a specific role

Method: GET /roles/{idOrName}

Parameters

  • idOrName – The role name can be one of the following: admin, contributor, consumer.
  • compiledRole – Use the default setting (true)

Example API Call

/api/roles/consumer?compiledRole=true

Change a specific setting for a specific role

Method: PUT /roles/{idOrName}/manifest/{path}

Parameters

  • idOrName – The role name can be one of the following: admin, contributor, consumer.
  • Path – Enter the path to the setting that you want to change as it appears in the hierarchy. Do not include the setting in the path. Example: To change the ‘Create’ setting for dashboard filters, enter dashboards/filters/. For creating dashboards, enter /dashboards. See the reference table above for more settings.
  • Manifest – Defines whether to enable or disable the setting. For example, to enable ‘create’, type in: {“create”: true}

 

consumer

Example API Call

/api/roles/viewer/manifest/dashboards/filters

Note: You can use POST to do the same action, but for POST all other options will be reset to their default settings.

Restore a specific setting for a specific role

Method: DELETE /roles/{idOrName}/manifest/{path}

Parameters

  • idOrName – The role name can be one of the following: admin, contributor, consumer.
  • Path – Enter the full path of the setting you want to change, as it appears in the hierarchy. Example: dashboards/filters/modify_type. See the reference table above for more settings.

Example API Call

/api/roles/viewer/manifest/dashboards/filters/modify_type

Restore all settings for a specific role

Method: DELETE /roles/{idOrName}/manifest/{path}

Parameters

  • idOrName – The role name can be one of the following: admin, contributor, consumer.
  • Path – /
    Enter just a slash to restore all settings.

Example API Call

/api/roles/viewer/manifest/

The following video tutorial demonstrates the above procedure.