Skip to main content

Rego's Built-in Functions for Time

One of the most powerful features of Rego is building access controls beyond simple models like RBAC. Time-based access controls are a common requirement in many applications, and Rego provides many helpful built-in functions to work with time.

Some examples of time-based, permissions are:

  • Validating tokens have not expired
  • Granting business hour/day access, or enforcing maintenance windows
  • Enabling systems for temporary access, such as share links or time-limited access
  • Validating user input, for example that a time period within a permitted range.

The examples in this section will cover these use cases in detail.