Solved

actions/workspaces/workspace_id/analyticalDashboards/dashboard_id/managePermissions fails

  • 12 May 2023
  • 1 reply
  • 33 views

curl --location 'https://mydomain.cloud.gooddata.com/api/v1/actions/workspaces/<workspace_id>/analyticalDashboards/<dashboard_id>/managePermissions' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer <token>' \
--data '[
    {
        "assigneeIdentifier": {
        "id": "bright_funds_dashboard_viewers",
        "type": "userGroup"
        },
        "permissions": ["VIEW"]
    }
]'

Usually results in a 400 bad request error:
{
    "detail": "[Path '/0'] Object has missing required properties ('id','type')",
    "status": 400,
    "title": "Bad Request",
    "traceId": "c32ef6d240a5fcd0"
}

but if I mash the button enough times it seems to work /shrug.

Also note the json payload documented here: https://www.gooddata.com/developers/cloud-native/doc/cloud/api-and-sdk/api/api_reference_all/#operation/manageDashboardPermissions

Does not match the format of the json payload documented here: https://www.gooddata.com/developers/cloud-native/doc/cloud/manage-organization/manage-permissions/set-permissions-for-dashboards/

asignee vs assigneeIdentifier - assigneeIdentifier - I tried both.

Also, I swear I’ve seen this intermittently work so I believe I’m formatting the request properly.

icon

Best answer by Moises Morales 12 May 2023, 19:53

View original

1 reply

Userlevel 3

Hi Scott, 

We're aware of this problem with the managePermissions API endpoint. There is a specific race condition that can prevent the JSON validation from resolving correctly and, unfortunately, your organization is affected.

We're working on a fix for this problem which would, according to the current schedule, be delivered with the next GoodData Cloud release on May 18th. This is because the problem has (or had) a very narrow impact.

 

In the meantime, you can use the workaround below: 

  1. Retreive the layout for your workspace using GET to endpoint /api/v1/layout/workspaces/{{workspace_id}}. This will produce a large JSON file.
  2. Find the required dashboard using their ID. Each dashboard also has a permissions object.
  3. Modify this object so that the userGroup you want to be able to see/edit the dashboard is included.
  4. Take the entire JSON output with this change and PUT it back to the same endpoint. This will grant the permissions as specified without having to rely on the currently impacted managePermissions endpoint.
  5. The layout API is quite powerful, so I would advise to first try this on a dummy workspace so you know how it works and no unwanted changes are introduced.

You can stay tuned to our release notes on this page: Release Notes

 

-Moises

Reply