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'.
()
| 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'. |
| 400 | func (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 | |
| 407 | func (TemplateVersion) RBACObject(template Template) rbac.Object { |
| 408 | // Just use the parent template resource for controlling versions |
no outgoing calls
no test coverage detected