posthog
posthog copied to clipboard
fix: cannot create an insight onto a dashboard when no permissions
Problem
see this community slack thread: https://posthogusers.slack.com/archives/C01GLBKHKQT/p1671547613708909
When duplicating an insight we POST the insight to the insight API. One of the results is a tile is created to link the new insight to any dashboard the existing insight was on.
In the thread we discuss that may not be desired... but also that you can duplicate an insight onto a dashboard you don't have permissions to change. It turns out permissions were enforced when PATCHing an insight but not when POSTing
Changes
- checks dashboard permissions on insight create
- checks dashboard permissions on dashboard duplication
- shows a toast when duplication fails

How did you test this code?
running it locally
This PR hasn't seen activity in a week! Should it be merged, closed, or further worked on? If you want to keep it open, post a comment or remove the stale
label – otherwise this will be closed in another week.
going to queue this behind #13492
This PR hasn't seen activity in a week! Should it be merged, closed, or further worked on? If you want to keep it open, post a comment or remove the stale
label – otherwise this will be closed in another week.
This PR was closed due to lack of activity. Feel free to reopen if it's still relevant.
Has this been queued somewhere else? @pauldambra 👀