Customizing User Roles
  • 29 Mar 2022
  • 5 Minutes to read
  • Dark
    Light

Customizing User Roles

  • Dark
    Light

This topic describes how to customize the permissions given to the Sisense user roles, using Sisense’s REST API .

Click here to learn more about each role type.

For a short video tutorial, see below:

Customizing Roles

You can customize the 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

DashboardsAdminData AdminData DesignerDesignerViewer
create
Create a new dashboard.
TrueTrueTrueTrueNever
duplicate
Duplicate an existing dashboard.
TrueTrueTrueTrueFalse
change_owner
Change the dashboard' owner.
TrueTrueTrueTrueFalse
toggle_edit_mode
Select 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.
TrueTrueTrueTrueFalse
edit_script
Edit a dashboard using the Sisense JavaScript API.
TrueTrueTrueTrueNever
export_dash
Export a dashboard as a .dash file that can be imported back into Sisense.
TrueTrueTrueTrueNever
export_jpeg
Download a widget as an image in PNG format. The downloaded image represents the current view.
TrueTrueTrueTrueTrue
export_pdf
Export the dashboard to PDF format. The exported file includes the current view.
TrueTrueTrueTrueTrue
restore
Revert changes made in the dashboard to the latest dashboard that was shared.
TrueTrueTrueTrueTrue
copy_to_server
Copy the dashboard to another server.
TrueTrueTrueTrueFalse
import
Import a .dash file into the Sisense Web Application.
TrueTrueTrueTrueNever
select_palette
Change the selected color palette.
TrueTrueTrueTrueNever
replace_datasource
Select a new data source for a dashboard.
TrueTrueTrueTrueNever
undo_import_dashTrue TrueTrueTrueFalse
Filters     
create
Create a new filter.
TrueTrueTrueTrueFalse
on_off
Switch filters on or off.
TrueTrueTrueTrueTrue
toggle_expansion
Enable the expansion of filter settings to see more filter parameters.
TrueTrueTrueTrueTrue
toggle_auto_update
Include the option to update the dashboard following every change
TrueTrueTrueTrueFalse
modify_type
Include in the filter options 'Ranking' and 'Starred', in addition to 'List' and 'Text'.
TrueTrueTrueTrueFalse
set_defaults
Include in the dashboard menu the option to set the dashboard filters as the default filters for the dashboard.
TrueTrueTrueTrueFalse
advanced
Include the Advanced menu option for creating custom filters.
TrueTrueTrueTrueFalse
use_starred
Include the option to use filters that have been starred
TrueTrueTrueTrueFalse

Widgets

WidgetsAdminData AdminData DesignerDesignerViewer
create
Create a new widget.
TrueTrueTrueTrueNever
delete
Delete a widget.
TrueTrueTrueTrueFalse
rename
Rename a widget.
TrueTrueTrueTrueFalse
duplicate
Duplicate a widget.
TrueTrueTrueTrueNever
copy_to_dashboard
Copy a widget to a dashboard. This functionality allows you to drag and drop widgets to additional dashboards in your Navigation Pane.
TrueTrueTrueTrueFalse
edit_script
Edit a widget using the JavaScript API.
TrueTrueTrueTrueNever
change_type
Change the chart type.
TrueTrueTrueTrueFalse
export_csv
Export a widget's data to a CSV file.
TrueTrueTrueTrueTrue
export_png
Download a widget as an image in the PNG format. The downloaded image represents the current view.
TrueTrueTrueTrueTrue
modify_selection_mode
Enable the option to change the filter behavior between 'Slice' (only filtered items are included in the chart) and 'Highlight' (filters items are highlighted).
TrueTrueTrueTrueFalse
drill_to_anywhere
Enable 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).
TrueTrueTrueTrueTrue
add_to_pulse
Include the option to add a widget to Pulse if the widget type is supported.
TrueTrueTrueTrueTrue
Items     
reorder
Reorder the fields and values in the data panel and their representation in the chart.
TrueTrueTrueTrueFalse
modify_type
Enables the option to edit values and categories in the data panel.
TrueTrueTrueTrueNever
on_off
Enable the option to turn fields on or off in the widget.
TrueTrueTrueTrueTrue
select_hierarchies
Include the option to select pre-defined hierarchies.
TrueTrueTrueTrueFalse
sql_api
Access the SQL API.
True
(Cannot be modified)
True
(Cannot be modified)
FalseFalseFalse
Filters     
on_off
Switch filters on or off.
TrueTrueTrueTrueFalse
toggle_expansion
Enable the expansion of filter settings to display more filter parameters.
TrueTrueTrueTrueTrue
modifyTrueTrueTrueTrueFalse
modify_type
Include in the filter options 'Ranking' and 'Starred', in addition to 'List' and 'Text'
TrueTrueTrueTrueFalse
use_starred
Enables the option to star (bookmark as favorite) a filter selection.
TrueTrueTrueTrueFalse

ElastiCubes

This object is not displayed in the Sisense REST API, however, you can still toggle these features through the POST /roles/{idOrName}/manifest/{path} endpoint.

The value of path should be in the format of manage/elasticubes/[value], where [value] is the feature listed in the table below.

8-5customroleapi1thumb0300.png

ElastiCubesAdminData AdminData DesignerDesignerViewer
add
Allows the user to add new ElastiCubes.
TrueTrueTrueFalseFalse
schedule_build
Allows the user to schedule builds for an ElastiCube.
TrueTrueTrueFalseFalse
modify_data_security_rights
Allows editing the row-based data security permissions.
TrueTrueTrueFalseFalse

Changing Permissions

To change permissions for a user role:

  1. In the Sisense , click Admin at the top-right of the screen, and then REST API in the left menu to view the API documentation.

  2. In the API Documentation, select version 0.9 on the top-right of the screen.

  3. Click roles to access the different API operations related to roles.

  4. Open the operation that you require (see Examples below), and then click Test It Out.

  5. In the list of fields that opens, enter or select the required parameters.

    your title goes here

    The API uses a previous terminology for Designers and Viewers. When entering the role name into the operation parameters, enter 'contributor' for the Designer role, and 'consumer' for the Viewer role.

    When changing a permission for a role, you must use the Path parameter, which defines the relative path to the permission you want to change in the hierarchy of permissions. To view the current hierarchy of permissions, scroll down to the Example Value in the Responses section. For example, to change the ‘Create’ setting for dashboard filters, enter 'dashboards/filters/'. To create dashboards, enter 'dashboards/'.

    Append your path with the "/" symbol.

    8-5roles-perm-2thumb0300.png

  6. When changing a permission for a role, go right into the list of permissions in the Manifest parameter, and type in the desired permission (for example, change 'true' to 'false').

    8-5CustomroleGIF1.gif

    Then remove everything else from the list of permissions, including the heading ("dashboards":), the extra brackets and the extra commas.

    8-5CustomroleGIF2.gif

  7. Click Execute to apply the changes.

  8. Scroll down to the Responses section to verify that the response has no errors.

Once you have no errors, your change is applied to all users assigned the relevant role.

Examples

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}

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: super, dataDesigner, dataAdmin, 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: super, dataDesigner, dataAdmin, admin, contributor, consumer.
  • Path – / Enter just a slash to restore all settings.

Example API Call

/api/roles/viewer/manifest/


Was this article helpful?