@@ -267,27 +267,45 @@ func (api *API) serveEntitlements(rw http.ResponseWriter, r *http.Request) {
267
267
Entitlement : entitlements .auditLogs ,
268
268
Enabled : api .AuditLogging ,
269
269
}
270
- if entitlements .auditLogs == codersdk .EntitlementGracePeriod && api .AuditLogging {
271
- resp .Warnings = append (resp .Warnings ,
272
- "Audit logging is enabled but your license for this feature is expired." )
270
+ if api .AuditLogging {
271
+ if entitlements .auditLogs == codersdk .EntitlementNotEntitled {
272
+ resp .Warnings = append (resp .Warnings ,
273
+ "Audit logging is enabled but your license is not entitled to this feature." )
274
+ }
275
+ if entitlements .auditLogs == codersdk .EntitlementGracePeriod {
276
+ resp .Warnings = append (resp .Warnings ,
277
+ "Audit logging is enabled but your license for this feature is expired." )
278
+ }
273
279
}
274
280
275
281
resp .Features [codersdk .FeatureBrowserOnly ] = codersdk.Feature {
276
282
Entitlement : entitlements .browserOnly ,
277
283
Enabled : api .BrowserOnly ,
278
284
}
279
- if entitlements .browserOnly == codersdk .EntitlementGracePeriod && api .BrowserOnly {
280
- resp .Warnings = append (resp .Warnings ,
281
- "Browser only connections are enabled but your license for this feature is expired." )
285
+ if api .BrowserOnly {
286
+ if entitlements .browserOnly == codersdk .EntitlementNotEntitled {
287
+ resp .Warnings = append (resp .Warnings ,
288
+ "Browser only connections are enabled but your license is not entitled to this feature." )
289
+ }
290
+ if entitlements .browserOnly == codersdk .EntitlementGracePeriod {
291
+ resp .Warnings = append (resp .Warnings ,
292
+ "Browser only connections are enabled but your license for this feature is expired." )
293
+ }
282
294
}
283
295
284
296
resp .Features [codersdk .FeatureWorkspaceQuota ] = codersdk.Feature {
285
297
Entitlement : entitlements .workspaceQuota ,
286
298
Enabled : api .UserWorkspaceQuota > 0 ,
287
299
}
288
- if entitlements .workspaceQuota == codersdk .EntitlementGracePeriod && api .UserWorkspaceQuota > 0 {
289
- resp .Warnings = append (resp .Warnings ,
290
- "Workspace quotas are enabled but your license for this feature is expired." )
300
+ if api .UserWorkspaceQuota > 0 {
301
+ if entitlements .workspaceQuota == codersdk .EntitlementNotEntitled {
302
+ resp .Warnings = append (resp .Warnings ,
303
+ "Workspace quotas are enabled but your license is not entitled to this feature." )
304
+ }
305
+ if entitlements .workspaceQuota == codersdk .EntitlementGracePeriod {
306
+ resp .Warnings = append (resp .Warnings ,
307
+ "Workspace quotas are enabled but your license for this feature is expired." )
308
+ }
291
309
}
292
310
293
311
httpapi .Write (ctx , rw , http .StatusOK , resp )
0 commit comments