Skip to content

Commit

Permalink
Timespace construct not available in recent vault versions (tested in…
Browse files Browse the repository at this point in the history
… 0.10.*)
  • Loading branch information
ncorrare committed Jul 31, 2018
1 parent 1d28f66 commit 7babaf1
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions governance/sentinel/businesshours-policy.sentinel
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@ import "time"

# We expect requests to only happen during work days (0 for Sunday, 6 for Saturday)
workdays = rule {
timespace.weekday > 0 and timespace.weekday < 6
time.now.weekday > 0 and time.now.weekday < 6
}

# We expect requests to only happen during work hours
workhours = rule {
timespace.hour > 7 and timespace.hour < 18
time.now.hour > 7 and time.now.hour < 18
}

main = rule {
workdays and workhours
}
}

0 comments on commit 7babaf1

Please sign in to comment.