0
0
mirror of https://github.com/PostHog/posthog.git synced 2024-11-24 18:07:17 +01:00
posthog/ee/urls.py

47 lines
1.5 KiB
Python
Raw Normal View History

2021-08-27 16:20:49 +02:00
from typing import Any, List
from django.urls.conf import path
from rest_framework_extensions.routers import NestedRegistryItem
from ee.api import integration
from posthog.api.routing import DefaultRouterPlusPlus
from .api import (
authentication,
2022-10-19 08:58:36 +02:00
billing,
dashboard_collaborator,
debug_ch_queries,
explicit_team_member,
hooks,
license,
subscription,
)
2022-02-08 17:22:09 +01:00
def extend_api_router(
root_router: DefaultRouterPlusPlus,
*,
projects_router: NestedRegistryItem,
project_dashboards_router: NestedRegistryItem,
2022-02-08 17:22:09 +01:00
) -> None:
2022-10-19 08:58:36 +02:00
root_router.register(r"billing-v2", billing.BillingViewset, "billing")
root_router.register(r"license", license.LicenseViewSet)
root_router.register(r"debug_ch_queries", debug_ch_queries.DebugCHQueries, "debug_ch_queries")
root_router.register(r"integrations", integration.PublicIntegrationViewSet)
projects_router.register(r"hooks", hooks.HookViewSet, "project_hooks", ["team_id"])
Project-based permissioning framework (#5976) * Refactor `AvailableFeature` from strings to an enum everywhere * Fix circular dependency and type * Add "Per-project access" feature flag, premium feature, and organization switch * Rename `OrganizationMembershipLevel` to `OrganizationAccessLevel` * Create `ExplicitTeamMembership` model * Show whether projects are restricted in the project switcher * Update organizations API code * Fix migrations * Move organization tests that require EE to `ee` * Revert `OrganizationMembershipLevel` rename * Fix organization tests * Update migration * Fix schema and add Members to Project Settings * Build out test memberships API with security tests * Update `TeamMembers` and `teamMembersLogic` * Move "Per-project access" description to tooltip * Add moar tests * Fix Project Members list logic * Add additional membership checks * Update migrations * Fix typing * Adjust explicit team memberships API similarly * Fix typo * Unify `ExplicitTeamMemberSerializer` * Remove old changes to `membersLogic` usage * Use `effective_membership_level` on `TeamBasicSerializer` * Clean up organization update tests * Explicitly disallow enabling per-project access for free * Fix circular import * Remove `id` from `UserSerializer` * Fix typing * Try to fix import * Fix fatal typing * Add more tests * Update permissioning.ts * Add clarifying comment to migration * Fix import * minor clarifications * Revert `TopNavigation` changes * Make new access control entirely project-based * Update migrations * Add `project_based_permissioning` to `TeamBasicSerializer` * Update test_team.py * Fix Access Control restriction tooltip * adjust copy & UI a bit * Address feedback on field comment * "Privacy settings" to "Access Control" * Ignore mypy * Rename `Team` field `project_based_permissioning` to `access_control` * Update migrations Co-authored-by: Paolo D'Amico <paolodamico@users.noreply.github.com>
2021-09-22 18:29:59 +02:00
projects_router.register(
r"explicit_members", explicit_team_member.ExplicitTeamMemberViewSet, "project_explicit_members", ["team_id"]
)
2022-02-08 17:22:09 +01:00
project_dashboards_router.register(
r"collaborators",
dashboard_collaborator.DashboardCollaboratorViewSet,
"project_dashboard_collaborators",
["team_id", "dashboard_id"],
)
2021-08-27 16:20:49 +02:00
projects_router.register(r"subscriptions", subscription.SubscriptionViewSet, "subscriptions", ["team_id"])
2021-08-27 16:20:49 +02:00
urlpatterns: List[Any] = [path("api/saml/metadata/", authentication.saml_metadata_view)]