Skip to content

insights: return grants with dashboards via the API

Administrator requested to merge insights/api/add-dashboard-grants into main

Created by: CristinaBirkel

Closes: #26309 (closed)

Coury: I'm going to do some more manual testing on this tomorrow morning when my brain is rested, but I think I got all the various cases. It ended up being more involved than I originally thought, so I wanted to tag you on this now in case you have any major comments on the code. Thanks!

Description

grants are now returned as a part of the InsightsDashboard type.

Also, I had to modify some of the other resolvers and store methods so that they could return the grants. I chose to also add a check to make sure that the user has permissions for the dashboard they're trying to modify, and if not it now returns an error.

Testing Steps

Try out the insightsDashboard query, as well as the update, create, add/remove insight mutations to make sure the grants are being accurately returned. Example:

query {
  insightsDashboards() {
		nodes { id, title, grants { users, organizations, global }}
  }
}

Merge request reports

Loading