Enforcer provides the following categories of Oasis attributes accessible from ALFA. These attributes can be used as part of an expression inside a policy.
To make use of these attributes from inside an ALFA file, use the appropriate import statement:
import Oasis.Attributes
import Enforcer.Attributes
These attributes and their properties are also available in .Net code under the Rsk.Enforcer
namespace.
using Rsk.Enforcer;
// Usage
Oasis.Attributes.Resource.Id; // "Resource"
Environment Attributes
Current Date
Namespace : Oasis.Attributes
attribute CurrentDate
{
id = "current-date"
category = environmentCat
type = date
}
Current Time
Namespace : Oasis.Attributes
attribute CurrentTime
{
id = "current-time"
category = environmentCat
type = time
}
Current DateTime
Namespace : Oasis.Attributes
attribute CurrentDateTime
{
id = "current-dateTime"
category = environmentCat
type = dateTime
}
Current Day of Week
Namespace : Oasis.Attributes
attribute CurrentDayOfWeek
{
id = "current-dayOfWeek"
category = environmentCat
type = integer
}
Value | Day of week |
---|---|
1 | Sunday |
2 | Monday |
3 | Tuesday |
4 | Wednesday |
5 | Thursday |
6 | Friday |
7 | Saturday |
Current Date UTC
Namespace : Enforcer.Attributes
attribute CurrentDateUTC
{
id = "current-date-utc"
category = environmentCat
type = date
}
Current Time UTC
Namespace : Enforcer.Attributes
attribute CurrentTimeUTC
{
id = "current-time-utc"
category = environmentCat
type = time
}
Current DateTime UTC
Namespace : Enforcer.Attributes
attribute CurrentDateTimeUTC
{
id = "current-dateTime-utc"
category = environmentCat
type = dateTime
}
Current Day of Week UTC
Namespace : Enforcer.Attributes
attribute CurrentDayOfWeekUTC
{
id = "current-dayOfWeek-utc"
category = environmentCat
type = integer
}
Value | Day of week |
---|---|
1 | Sunday |
2 | Monday |
3 | Tuesday |
4 | Wednesday |
5 | Thursday |
6 | Friday |
7 | Saturday |