cancel
Showing results for 
Search instead for 
Did you mean: 

How to fetch a list of accessible dashboards for each user?

DeCha
7 - Data Storage
7 - Data Storage

I'm looking to do something simple. 

From my application, fetch a list of dashboards our logged in user has access to in Sisense.
Is there any way to cleanly do this via API without using the access token for each individual user and use an admin API? 

Or if access token is needed, somehow fetching the access token after logging in the user via OIDC SSO.

Otherwise, I'll have to fetch a user's groups and scan through /dashboard to find dashboards with matching group ids

1 ACCEPTED SOLUTION

AssafHanina
Sisense Team Member
Sisense Team Member

Hey @DeCha and @HamzaJ,

In addition to the suggested plugin by @Ravid_PaldiTeam , if you would like a dashboard that displays the list of dashboards along with the users/groups they are shared with, you can build it using the following APIs(Using Admin Token):

  1. GET /api/v1/dashboards/admin 
    - Fetches the list of all dashboards
    - shared object for each dashboard, which includes the user/group ID with whom the dashboard is shared. 
  2. GET /api/v1/users 
    - Retrieves all users list 
    - Retrieves user role id 
    - Object Groups - require to parse as it's contain a list of Group id's which the users is belongs to. 
  3. GET /api/roles - Fetches the list of all roles.
  4. GET /api/v1/groups - Fetches the list of all groups.

Possible Implementation:
create CSV tables or Tables in the database (in case it's API base with Scheduler) as the following structure and build a data model on top of it. 

  1. Create Users Dimension Table and Merge Users info with Roles Info. 
  2. Create Groups Dimension Table.
  3. Create Users Group Table, which is a Union ALL of the following sub tables: 
    - Parse the Object groups from GET /api/v1/users - it will provide the list of users and Groups.
    - Everyone Group - is a sisense default groups which means all users belong to the same tenant. 
      Dashboard shared with Everyone, means all users has access. 
      * Get the Everyone Group ID from the Groups table and assign all users to this group id
    - Admin Group - is a sisense default group which contain the list of all Admin users.
      Admin Users are users which have the following Roles: Sys. Admin, Admin, Data Admin, Tenant Admin (for multi tenant cases).
    * Get the Admins Group ID from the Groups table and assign all users with Admin roles
  4. Create Dashboard (Fact) table - Note that the dashboards API can provide multiple records for the same Dashboard OID.
    Table Logic breaks into the following sub tables: 
    - First table - Share type = 'User'
    - Second table - filter on Share type = 'Group' and join the dashboard information with the Users_groups table. this join will translate the information of the Dashboard shared with Groups into the users belongs to that Groups. 
    - Use Union to remove duplication records.

Best Regards

 

Assaf

View solution in original post

4 REPLIES 4

HamzaJ
12 - Data Integration
12 - Data Integration

Hey @DeCha ,

I dont think there is such an endpoint/feature. Would be nice though. I know @Ravid_PaldiTeam has a plugin called User Access which does exactly this, but only in Sisense itself. Perhaps he can extend it with an API.

The way we do it now (which could perhaps be usefull for you) is to import the Sisense application DB in an Elasticube. Do some datamodelling and create a table that specifically shows per user to which dashboards they have access to (either directly or via a group). When you did this, you could query this table via an API. The only thing you would need is userID or the user's email

Hamza

Ravid_PaldiTeam
9 - Travel Pro
9 - Travel Pro

Hi @DeCha 

You need to use the "/adminAccess parameter with a user who has admin privelages in order to use end point in behalf of other users. 

Indeed we have a free plugin that adds an "Info" button to the users lists page which shows all the dashboards that a user has access to. 

Ravid_PaldiTeam_0-1722349507322.png

It requires some logic to construct such list but belwo you can find the APIs that our plugin uses: 

  • /api/v1/dashboards/admin
  • /api/v1/users?email={userEmail}
  • /api/shares/dashboard/{oid}?adminAccess=true

Feel free to reach out in case you'd like to get our plugin or brainstrom on your use case

Thanks,

Ravid

[email protected] 

Paldi Solutions - Sisense Gold Certified Partner

 

DRay
Community Team Leader
Community Team Leader

Hello @DeCha ,

I wanted to follow up to see if the solutions offered by @HamzaJ or @Ravid_PaldiTeam worked for you.

If so, please click the 'Accept as Solution' button on the appropriate post, that way other users with the same questions can find the answer. If not, please let us know so that we can continue to help.

Thank you.

David Raynor (DRay)

AssafHanina
Sisense Team Member
Sisense Team Member

Hey @DeCha and @HamzaJ,

In addition to the suggested plugin by @Ravid_PaldiTeam , if you would like a dashboard that displays the list of dashboards along with the users/groups they are shared with, you can build it using the following APIs(Using Admin Token):

  1. GET /api/v1/dashboards/admin 
    - Fetches the list of all dashboards
    - shared object for each dashboard, which includes the user/group ID with whom the dashboard is shared. 
  2. GET /api/v1/users 
    - Retrieves all users list 
    - Retrieves user role id 
    - Object Groups - require to parse as it's contain a list of Group id's which the users is belongs to. 
  3. GET /api/roles - Fetches the list of all roles.
  4. GET /api/v1/groups - Fetches the list of all groups.

Possible Implementation:
create CSV tables or Tables in the database (in case it's API base with Scheduler) as the following structure and build a data model on top of it. 

  1. Create Users Dimension Table and Merge Users info with Roles Info. 
  2. Create Groups Dimension Table.
  3. Create Users Group Table, which is a Union ALL of the following sub tables: 
    - Parse the Object groups from GET /api/v1/users - it will provide the list of users and Groups.
    - Everyone Group - is a sisense default groups which means all users belong to the same tenant. 
      Dashboard shared with Everyone, means all users has access. 
      * Get the Everyone Group ID from the Groups table and assign all users to this group id
    - Admin Group - is a sisense default group which contain the list of all Admin users.
      Admin Users are users which have the following Roles: Sys. Admin, Admin, Data Admin, Tenant Admin (for multi tenant cases).
    * Get the Admins Group ID from the Groups table and assign all users with Admin roles
  4. Create Dashboard (Fact) table - Note that the dashboards API can provide multiple records for the same Dashboard OID.
    Table Logic breaks into the following sub tables: 
    - First table - Share type = 'User'
    - Second table - filter on Share type = 'Group' and join the dashboard information with the Users_groups table. this join will translate the information of the Dashboard shared with Groups into the users belongs to that Groups. 
    - Use Union to remove duplication records.

Best Regards

 

Assaf