0
0
mirror of https://github.com/PostHog/posthog.git synced 2024-11-28 09:16:49 +01:00
Commit Graph

4 Commits

Author SHA1 Message Date
Karl-Aksel Puulmann
4db2af5d7f
fix(query-performance): Speed up permissioning in API (#13952)
* Get #team_effective_membership_level under test

* Extract method into class

* Refactor team_effective_membership_level to require less lookups

* Test and scaffolding for dashboard methods

* Move dashboard methods to user_permissions

* Optimize dashboard methods

* Insights priviledge logic to user_permissions

* Make insight priviledge code efficient

* Fix bug to improve efficiency

* Refactor efficiency tests

* Use UserPermissions in some dashboard-related views

* Use UserPermissions in some insight-related views

* Fix a typo

* Remove insight, dashboard model methods

* Experiment: make shared dashboards not have effective_priviledge_levels/effective_restriction_level

* Remove team#get_effective_membership_level

* Simplify TeamBaseSerializer

* Update organization API

* Update UserViewSet

* update team view

* Reduce some lookups

* Make UserPermissions not dependant on organization being passed

* cast-to-user

* Test listing with basic as FE calls it

* Update dashboard views

* JOIN organizations table, dont rely on request.user.organization

* Update snapshots

* Handle shared dashboards slightly better

* Simplify team API

* Fix test_team.py

* Update middleware tests

* Update ee team tests

* Fully refactor a problematic call pattern

* Solve ee API errors

* Solve lint fails

* Reset in insights as well

* Cast

* Update snapshots

* Update snapshots

* Update snapshots

* Update snapshots

* Update snapshots

* Update snapshots

* Remove merge conflict

* Update snapshots

* Remove items

---------

Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
2023-01-30 11:44:16 +02:00
Michael Matloka
d7067544ad
Fix is_active being unused when querying User (#8793)
* Fix `is_active` being unused when querying `User`

* Simplify a `.filter()`

* Update test_feature_flag.ambr

* Remove `User.is_active` filter from `get_overridden_feature_flags`

* Fix exclude in `OrganizationMemberViewSet` queryset

* Revert snapshot update

* Update test_organization_members.py
2022-03-02 14:27:08 +00:00
Michael Matloka
db4111df8a
Finalize dashboard restrictions (#8527)
* Update test_insight.py

* Secure insight endpoint for dashboard restrictions

* Prohibit unauthorized deletion of restricted dashboard

* Update class name in snapshots

* Address feedback
2022-02-14 12:55:16 +00:00
Michael Matloka
3a678e7261
Dashboard privilege API and collaborators UI (#8424)
* Add basic `/api/projects/:id/dashboard/:id/collaborators`

* Handle more collaboration cases and add base tests

* Add some collaborators UI to share modal

* Improve Python typing

* Improve TS typing

* Allow addition and deletion of collaborators from UI

* Add upsell prototype

* Improve upsell button

* Add `effective_restriction_level` to `DashboardSerializer`

* Improve `LemonSelect` value handling

* Improve `LemonSelect` behavior when selecting existing value

* Refactor the way privilege level name is determined

* Don't destroy `ShareModal` on close to avoid logic remounting

* Split out upsell into own PR

* Fix TS

* Fix typing

* Increase security with more tests

* Inline `parents_query_dict`

* Dashboard collaborator bubbles (#8450)

* Add collaborator bubbles to restricted dashboard headers

* Rename `index.tsx` to `ProfilePicture.tsx` for readability

* Improve tooltip handling

* Create ProfileBubbles.stories.tsx

* Make collaborator bubbles tooltip dashboard-level

* Always show collaborator bubbles

* Dashboard restrictions (#8462)

* Add frontend-side restrictions editing restrictions to dashboards

* Restrict `InsightCard`

* Align info message margin

* Disallow locking yourself out of the dashboard

* Handle dashboard restrictions in the insight page

* Allow disabling `InsightsTable` series checkbox

* Fix minor issues

* Align .page-title-row height

* Fix typing

* Fix arg name

* Address review feedback

* Fix n+1 queries issue
2022-02-08 16:22:09 +00:00