mirror of
https://github.com/coder/coder.git
synced 2025-07-13 21:36:50 +00:00
chore: keep entitlements in the options only, simplify fields (#14434)
* chore: refactor entitlements to keep it in just the options Duplicating the reference did not feel valuable, just confusing
This commit is contained in:
@ -18,7 +18,7 @@ const TimeFormatHHMM = "15:04"
|
||||
|
||||
func (api *API) autostopRequirementEnabledMW(next http.Handler) http.Handler {
|
||||
return http.HandlerFunc(func(rw http.ResponseWriter, r *http.Request) {
|
||||
feature, ok := api.entitlements.Feature(codersdk.FeatureAdvancedTemplateScheduling)
|
||||
feature, ok := api.Entitlements.Feature(codersdk.FeatureAdvancedTemplateScheduling)
|
||||
if !ok || !feature.Entitlement.Entitled() {
|
||||
httpapi.Write(r.Context(), rw, http.StatusForbidden, codersdk.Response{
|
||||
Message: "Advanced template scheduling (and user quiet hours schedule) is an Enterprise feature. Contact sales!",
|
||||
|
Reference in New Issue
Block a user