cancel
Showing results for 
Search instead for 
Did you mean: 
JeremyFriedel
Sisense Team Member
Sisense Team Member

Automating Dashboard Ownership Transfer in Sisense with UserReplaceTool

Managing and deleting user accounts in Sisense can create manual processes when users leave an organization or change roles. A frequent issue is the reassignment of dashboard ownership to prevent losing Sisense dashboards when a given user account is deleted, as deleting a Sisense user will delete all dashboards owned by that user. The UserReplaceTool addresses this task by automating the transfer of dashboard ownership of all dashboards owned by a given user, ensuring continuity and data integrity.

Overview

UserReplaceTool is a Python-based, API-based Tool solution designed to seamlessly transfer the ownership of dashboards and data models from one user to another in Sisense. This tool simplifies and automates this process, allowing organizations to reassign dashboard ownership without manual processes or the risk of losing dashboards and widgets. All components are accomplished by using Sisense API endpoint requests.

Key Features

  • Automated Dashboard Transfer: Reassigns ownership of all dashboards from the current user to a designated replacement user.
  • Data Model Sharing: Ensures that all data models accessible and editable by the previous user are shared with the replacement user.
  • Batch User Processing: Capable of handling multiple user transfers to a replacement user in a single operation, enhancing efficiency.
  • Complete Logging: All dashboards and datasource transferred are logged both in the console and in a separate log file.

Setup Instructions

1. Setting Up the Environment

To run the tool within a Python virtual environment, follow these steps:

  1. Activate the Python Virtual Environment:
    source /venv/bin/activate
  2. Create a Virtual Environment (if not already present):
    python3 -m venv .venv
  3. Install Dependencies:
    pip3 install -r requirements.txt
    For manual installation, including without using a Python virtual environment:
    pip3 install urllib3 jsonpath_ng pyyaml requests colorama

2. Configuration

Edit the settings.yaml file to configure the tool. Key parameters include:

  • Sisense Domain and Port: Specify the URL and port of your Sisense server, which is used for making API requests.
  • API Bearer Token: Provide an admin-level bearer token for API authentication. See the Sisense API Bearer Token Documentation for instructions on generating and using Bearer Tokens.
  • Users to Replace: List the user IDs to be replaced. User IDs can be retrieved via the Users API or using the console command prism.user._id.
  • Replacement User: Specify the user ID of the new replacement owner of all dashboards. This should typically be an admin level user.
  • Data Model Sharing: Enable or disable the sharing of data models with the Replacement user (True or False), usually True.
  • Dashboard Ownership Transfer: Enable or disable the transfer of dashboard ownership (True or False), usually True. Unlike Dashboards, if a user is deleted, the datasources themselves are not deleted from the server, ownership is automatically transferred to the main System Admin of the Sisense server. 

3. Running the Tool

Run the tool with the following command:

 
python3 replaceUser.py

Practical Considerations

  • Admin and Network Access: Ensure you have admin-level API access to the Sisense instance.
  • Python Environment: Python3 and pip should be installed on the machine running the tool. All dependencies can be installed using Pip, and a Python virtual environment can be used. Once a Python Virtual Environment folder is set up it can be shared with the Tool and run directly on all systems using the same OS, but it is not cross OS compatible.

By automating the transfer of dashboard ownership, UserReplaceTool provides a reliable and efficient solution for managing user transitions in Sisense. This ensures that datasources and dashboards remain accessible and under the control of the appropriate users, maintaining the continuity of Sisense resources.

For further customization and configuration details, refer to the attached full Python Tool, which includes a README file and modify the "settings.yaml" file as necessary.

 
Screen Shot 2024-07-21 at 4.15.44 PM.png
 
Screen Shot 2024-07-21 at 4.15.10 PM.png
Rate this article:
Version history
Last update:
‎07-23-2024 11:44 AM
Updated by: