feat: refactor deployment config (#6347)

This commit is contained in:
Ammar Bandukwala
2023-03-07 15:10:01 -06:00
committed by GitHub
parent bb0a996fc2
commit 3b73321a6c
102 changed files with 5643 additions and 6682 deletions

View File

@ -87,10 +87,10 @@ func (api *API) appearance(rw http.ResponseWriter, r *http.Request) {
}
}
if len(api.DeploymentConfig.Support.Links.Value) == 0 {
if len(api.DeploymentValues.Support.Links.Value) == 0 {
cfg.SupportLinks = DefaultSupportLinks
} else {
cfg.SupportLinks = api.DeploymentConfig.Support.Links.Value
cfg.SupportLinks = api.DeploymentValues.Support.Links.Value
}
httpapi.Write(r.Context(), rw, http.StatusOK, cfg)
@ -119,7 +119,7 @@ func validateHexColor(color string) error {
func (api *API) putAppearance(rw http.ResponseWriter, r *http.Request) {
ctx := r.Context()
if !api.Authorize(r, rbac.ActionUpdate, rbac.ResourceDeploymentConfig) {
if !api.Authorize(r, rbac.ActionUpdate, rbac.ResourceDeploymentValues) {
httpapi.Write(ctx, rw, http.StatusForbidden, codersdk.Response{
Message: "Insufficient permissions to update appearance",
})