0
0
mirror of https://github.com/PostHog/posthog.git synced 2024-11-25 11:17:50 +01:00
Commit Graph

11 Commits

Author SHA1 Message Date
Michael Matloka
94d0d32b3c
chore(environments): Add project_id-based filtering to API (#23246)
Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
2024-08-19 17:56:47 +02:00
Abenezer Belachew
318cae0ea2
Duplicate "user" in read_only_fields (#22314)
The read_only_fields list contains "user" twice
2024-05-20 12:48:33 +02:00
Julian Bez
9576fab1e4
chore: Add Pyupgrade rules (#21714)
* Add Pyupgrade rules
* Set correct Python version
2024-04-25 08:22:28 +01:00
Michael Matloka
97e66607a5
chore(api): Expose dashboard collaborator and org invite endpoints (#20874)
* chore(api): Make dashboard collaborator and org invite endpoints public

* Update query snapshots

---------

Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
2024-03-15 18:51:21 +01:00
Ben White
4dd3c35933
feat: Personal API key scopes (#20151) 2024-02-20 11:02:58 +00:00
Ben White
aff0d6349e
feat: Simplify standard permissions (#20172) 2024-02-12 13:55:21 +00:00
Tom Owers
5513be7731
chore: upgraded Ruff linter (#18188)
* Upgraded Ruff linter

* Formatted whole codebase with new ruff rules

* Revert import removal

* Fixed mypi issues or added ignores

* Fixed schema formatting

* Fixed hogvm failing tests

* Remove duplicate key in list
2023-10-26 12:38:15 +02:00
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