posthog icon indicating copy to clipboard operation
posthog copied to clipboard

fix: cannot create an insight onto a dashboard when no permissions

Open pauldambra opened this issue 2 years ago • 3 comments

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
Screenshot 2022-12-20 at 16 49 26

How did you test this code?

running it locally

pauldambra avatar Dec 20 '22 17:12 pauldambra

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.

posthog-bot avatar Dec 29 '22 07:12 posthog-bot

going to queue this behind #13492

pauldambra avatar Dec 29 '22 15:12 pauldambra

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.

posthog-bot avatar Jan 06 '23 07:01 posthog-bot

This PR was closed due to lack of activity. Feel free to reopen if it's still relevant.

posthog-bot avatar Jan 16 '23 07:01 posthog-bot

Has this been queued somewhere else? @pauldambra 👀

Twixes avatar Jan 16 '23 15:01 Twixes