Right now, we could be able to get the list of dashboards available to the users from the REST API directly. But we do not have a direct API to get the list of dashboards available to the group if the user is present in it.
So, please follow these steps to get the list of dashboards along with the permissions specific to the group if the user is present in it.
Generate the token with an email in the authorization server to impersonate the user. API to generate the token, please visit this link. Once the authentication succeeds, then the token will be generated as shown in the following image,
Once the token is generated, identify whether the user is present in the group or not. By passing the token in the authorization header to this GetGroupsOfUsersAPI which returns list of groups for the user id. From the list of groups, we can identify whether the expected group has returned from the API or not.
Next, we must get the list of permissions assigned to the group. For this, you must invoke this API and get the list of permissions as shown in the following image.
Then, invoke this API to get the list of dashboards accessible to the user and compare with the above permission list, and we can get the list of dashboards.
The above API will return all the dashboards belongs to the user. If the group permission API returns the ‘Specific Dashboard’ as follows, we have to get the list of item ids with the same entity and filter the same ids from the result returned from the above API.
Once we compared both lists, then we can get the details of the permission (CanEdit/CanRead/CanDelete)
for the dashboard for the specific user belongs to the specific group.