insights: Return a useful error message for invalid dashboard grants
Created by: CristinaBirkel
Closes https://github.com/sourcegraph/sourcegraph/issues/29774
Description:
When a user tries to create a dashboard with grants that it doesn't have permission to give, we used to just return nil
. Now we check for this case specifically and return an error message: user does not have permission to create this dashboard
.
Testing Steps:
I tested this out via the API, by trying to create dashboards that I had permissions to create, and ones that I did not have permission to create. It seems to be working but let me know if you see any issues!