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:
Steven Masley
2024-07-25 16:07:53 -05:00
committed by GitHub
parent 915f69080a
commit 7ea1a4c686
37 changed files with 2222 additions and 1678 deletions
+2 -7
View File
@@ -1167,12 +1167,7 @@ func (api *API) organizationsByUser(rw http.ResponseWriter, r *http.Request) {
return
}
publicOrganizations := make([]codersdk.Organization, 0, len(organizations))
for _, organization := range organizations {
publicOrganizations = append(publicOrganizations, convertOrganization(organization))
}
httpapi.Write(ctx, rw, http.StatusOK, publicOrganizations)
httpapi.Write(ctx, rw, http.StatusOK, db2sdk.List(organizations, db2sdk.Organization))
}
// @Summary Get organization by user and organization name
@@ -1200,7 +1195,7 @@ func (api *API) organizationByUserAndName(rw http.ResponseWriter, r *http.Reques
return
}
httpapi.Write(ctx, rw, http.StatusOK, convertOrganization(organization))
httpapi.Write(ctx, rw, http.StatusOK, db2sdk.Organization(organization))
}
type CreateUserRequest struct {