MCPcopy Index your code
hub / github.com/coder/coder / AutostartAllowedDays

Method AutostartAllowedDays

coderd/database/modelmethods.go:400–405  ·  view source on GitHub ↗

AutostartAllowedDays returns the inverse of 'AutostartBlockDaysOfWeek'. It is more useful to have the days that are allowed to autostart from a UX POV. The database prefers the 0 value being 'all days allowed'.

()

Source from the content-addressed store, hash-verified

398// It is more useful to have the days that are allowed to autostart from a UX
399// POV. The database prefers the 0 value being 'all days allowed'.
400func (t Template) AutostartAllowedDays() uint8 {
401 // Just flip the binary 0s to 1s and vice versa.
402 // There is an extra day with the 8th bit that needs to be zeroed.
403 // #nosec G115 - Safe conversion for AutostartBlockDaysOfWeek which is 7 bits
404 return ^uint8(t.AutostartBlockDaysOfWeek) & 0b01111111
405}
406
407func (TemplateVersion) RBACObject(template Template) rbac.Object {
408 // Just use the parent template resource for controlling versions

Callers 4

convertTemplateMethod · 0.80
ConvertTemplateFunction · 0.80
GetMethod · 0.80
SetMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected