mirror of
https://github.com/coder/coder.git
synced 2026-09-24 15:04:27 +08:00
chore: protect organization endpoints with license (#14001)
* chore: move multi-org endpoints into enterprise directory All multi-organization features are gated behind "premium" licenses. Enterprise licenses can no longer access organization CRUD.
This commit is contained in:
@@ -240,6 +240,27 @@ func New(ctx context.Context, options *Options) (_ *API, err error) {
|
||||
r.Delete("/", api.deleteWorkspaceProxy)
|
||||
})
|
||||
})
|
||||
|
||||
r.Group(func(r chi.Router) {
|
||||
r.Use(
|
||||
apiKeyMiddleware,
|
||||
api.RequireFeatureMW(codersdk.FeatureMultipleOrganizations),
|
||||
httpmw.RequireExperiment(api.AGPL.Experiments, codersdk.ExperimentMultiOrganization),
|
||||
)
|
||||
r.Post("/organizations", api.postOrganizations)
|
||||
})
|
||||
|
||||
r.Group(func(r chi.Router) {
|
||||
r.Use(
|
||||
apiKeyMiddleware,
|
||||
api.RequireFeatureMW(codersdk.FeatureMultipleOrganizations),
|
||||
httpmw.RequireExperiment(api.AGPL.Experiments, codersdk.ExperimentMultiOrganization),
|
||||
httpmw.ExtractOrganizationParam(api.Database),
|
||||
)
|
||||
r.Patch("/organizations/{organization}", api.patchOrganization)
|
||||
r.Delete("/organizations/{organization}", api.deleteOrganization)
|
||||
})
|
||||
|
||||
r.Route("/organizations/{organization}/groups", func(r chi.Router) {
|
||||
r.Use(
|
||||
apiKeyMiddleware,
|
||||
|
||||
Reference in New Issue
Block a user