PolicyCondition expressions
Table of contents
PolicyCondition expressions are used to reference Policy Conditions. They can return PolicyConditionAtomic, PolicyConditionComposite and PolicyConditionDefault entities. Parser command to be invoked is PEELParser(str).parseCondition()
and it returns IPolicyCondition entity.
Command table
Command | Type | format | options | |
---|---|---|---|---|
*gt | PolicyConditionAtomic | *gt(<PolicyVariable|Reference>{2,2},#opts?) | negateResult(*), stringIgnoreCase(*) | |
*gte | PolicyConditionAtomic | *gte(<PolicyVariable|Reference>{2,2},#opts?) | negateResult(*), stringIgnoreCase(*) | |
*lt | PolicyConditionAtomic | *lt(<PolicyVariable|Reference>{2,2},#opts?) | negateResult(*), stringIgnoreCase(*) | |
*lte | PolicyConditionAtomic | *lte(<PolicyVariable|Reference>{2,2},#opts?) | negateResult(*), stringIgnoreCase(*) | |
*isNull | PolicyConditionAtomic | *isNull(<PolicyVariable|Reference>{1,1},#opts?) | negateResult(*) | |
*notNull | PolicyConditionAtomic | *notNull(<PolicyVariable|Reference>{1,1},#opts?) | negateResult(*) | |
*isEmpty | PolicyConditionAtomic | *isEmpty(<PolicyVariable|Reference>{1,1},#opts?) | negateResult(*) | |
*notEmpty | PolicyConditionAtomic | *notEmpty(<PolicyVariable|Reference>{1,1},#opts?) | negateResult(*) | |
*isBlank | PolicyConditionAtomic | *isBlank(<PolicyVariable|Reference>{1,1},#opts?) | negateResult(*) | |
*notBlank | PolicyConditionAtomic | *notBlank(<PolicyVariable|Reference>{1,1},#opts?) | negateResult(*) | |
*sw | PolicyConditionAtomic | *sw(<PolicyVariable|Reference>{2,2},#opts?) | negateResult(*), stringIgnoreCase(*), fieldsStrictCheck(*), arrayOrderStrictCheck(*) | |
*ew | PolicyConditionAtomic | *ew(<PolicyVariable|Reference>{2,2},#opts?) | negateResult(*), stringIgnoreCase(*), fieldsStrictCheck(*), arrayOrderStrictCheck(*) | |
*contains | PolicyConditionAtomic | *contains(<PolicyVariable|Reference>{2,2},#opts?) | negateResult(*), stringIgnoreCase(*), fieldsStrictCheck(*), arrayOrderStrictCheck(*) | |
*isIn | PolicyConditionAtomic | *isIn(<PolicyVariable|Reference>{2,2},#opts?) | negateResult(*), stringIgnoreCase(*), fieldsStrictCheck(*), arrayOrderStrictCheck(*) | |
*eq | PolicyConditionAtomic | *eq(<PolicyVariable|Reference>{2,2},#opts?) | negateResult(*), stringIgnoreCase(*), fieldsStrictCheck(*), arrayOrderStrictCheck(*) | |
*pos | PolicyConditionAtomic | *pos(<PolicyVariable|Reference>{1,1},#opts?) | negateResult(*) | |
*neg | PolicyConditionAtomic | *neg(<PolicyVariable|Reference>{1,1},#opts?) | negateResult(*) | |
*zero | PolicyConditionAtomic | *zero(<PolicyVariable|Reference>{1,1},#opts?) | negateResult(*) | |
*past | PolicyConditionAtomic | *past(<PolicyVariable|Reference>{1,1},#opts?) | negateResult(*) | |
*future | PolicyConditionAtomic | *future(<PolicyVariable|Reference>{1,1},#opts?) | negateResult(*) | |
*regexp | PolicyConditionAtomic | *regexp(<PolicyVariable|Reference>{2,2},#opts?) | negateResult(*) | |
*hasKey | PolicyConditionAtomic | *hasKey(<PolicyVariable|Reference>{2,2},#opts?) | negateResult(*) | |
*unique | PolicyConditionAtomic | *unique(<PolicyVariable|Reference>{1,1},#opts?) | negateResult(*) | |
*schema | PolicyConditionAtomic | *schema(<PolicyVariable|Reference>{2,2},#opts?) | negateResult(*) | |
*any | PolicyConditionComposite | *any(<PolicyCondition|Reference>{1,},#opts?) | negateResult(*), strictCheck(*) | |
*all | PolicyConditionComposite | *all(<PolicyCondition|Reference>{1,},#opts?) | negateResult(*), strictCheck(*) | |
*not | PolicyConditionComposite | *not(<PolicyCondition|Reference>{1,1},#opts?) | negateResult(*) | |
*nOf | PolicyConditionComposite | *nOf(<PolicyCondition|Reference>{1,},#opts) | minimumConditions(**), negateResult(*), strictCheck(*), optimize(*) | |
#true | PolicyConditionDefault | #true(<>{0,0}) | ||
#false | PolicyConditionDefault | #false(<>{0,0}) | ||
#null | PolicyConditionDefault | #null(<>{0,0}) |
(*) - Boolean condition
(**) - Mandatory option
PolicyConditionAtomic
PolicyConditionAtomic expressions can only contain PolicyVariable commands or references to PolicyVariables
GreaterThan
Template: *gt(<PolicyVariable|Reference>{2,2},#opts?)
Command starts with *gt
It contains exactly two parameters of type PolicyVariable or Reference
Supported options:
negateResult
- boolean, default value is null. Negates condition resultstringIgnoreCase
- boolean, default value is null. Ignores casing when comparing strings
Minimal example:
*gt(#ref(pvd1), #int(0))
Full example with options:
*gt(#ref(pvd1), #ref(pvd2),#opts(id=cond,ver=1.2.3,desc="Some desc",labels=foo|bar,negateResult,stringIgnoreCase))
GreaterThanEqual
Template: *gte(<PolicyVariable|Reference>{2,2},#opts?)
Command starts with *gte
It contains exactly two parameters of type PolicyVariable or Reference
Supported options:
negateResult
- boolean, default value is null. Negates condition resultstringIgnoreCase
- boolean, default value is null. Ignores casing when comparing strings
Minimal example:
*gte(#ref(pvd1), #int(0))
Full example with options:
*gte(#ref(pvd1), #ref(pvd2),#opts(id=cond,ver=1.2.3,desc="Some desc",labels=foo|bar,negateResult,stringIgnoreCase))
LessThan
Template: *lt(<PolicyVariable|Reference>{2,2},#opts?)
Command starts with *lt
It contains exactly two parameters of type PolicyVariable or Reference
Supported options:
negateResult
- boolean, default value is null. Negates condition resultstringIgnoreCase
- boolean, default value is null. Ignores casing when comparing strings
Minimal example:
*lt(#ref(pvd1), #int(0))
Full example with options:
*lt(#ref(pvd1), #ref(pvd2),#opts(id=cond,ver=1.2.3,desc="Some desc",labels=foo|bar,negateResult,stringIgnoreCase))
LessThanEqual
Template: *lte(<PolicyVariable|Reference>{2,2},#opts?)
Command starts with *lte
It contains exactly two parameters of type PolicyVariable or Reference
Supported options:
negateResult
- boolean, default value is null. Negates condition resultstringIgnoreCase
- boolean, default value is null. Ignores casing when comparing strings
Minimal example:
*lte(#ref(pvd1), #int(0))
Full example with options:
*lte(#ref(pvd1), #ref(pvd2),#opts(id=cond,ver=1.2.3,desc="Some desc",labels=foo|bar,negateResult,stringIgnoreCase))
IsNull
Template: *isNull(<PolicyVariable|Reference>{1,1},#opts?)
Command starts with *isNull
It contains exactly one parameter of type PolicyVariable or Reference
Supported options:
negateResult
- boolean, default value is null. Negates condition result
Minimal example:
*isNull(#ref(pvd1))
Full example with options:
*isNull(#ref(pvd1),#opts(id=cond,ver=1.2.3,desc="Some desc",labels=foo|bar,negateResult))
NotNull
Template: *notNull(<PolicyVariable|Reference>{1,1},#opts?)
Command starts with *notNull
It contains exactly one parameter of type PolicyVariable or Reference
Supported options:
negateResult
- boolean, default value is null. Negates condition result
Minimal example:
*notNull(#ref(pvd1))
Full example with options:
*notNull(#ref(pvd1),#opts(id=cond,ver=1.2.3,desc="Some desc",labels=foo|bar,negateResult))
IsEmpty
Template: *isEmpty(<PolicyVariable|Reference>{1,1},#opts?)
Command starts with *isEmpty
It contains exactly one parameter of type PolicyVariable or Reference
Supported options:
negateResult
- boolean, default value is null. Negates condition result
Minimal example:
*isEmpty(#ref(pvd1))
Full example with options:
*isEmpty(#ref(pvd1),#opts(id=cond,ver=1.2.3,desc="Some desc",labels=foo|bar,negateResult))
NotEmpty
Template: *notEmpty(<PolicyVariable|Reference>{1,1},#opts?)
Command starts with *notEmpty
It contains exactly one parameter of type PolicyVariable or Reference
Supported options:
negateResult
- boolean, default value is null. Negates condition result
Minimal example:
*notEmpty(#ref(pvd1))
Full example with options:
*notEmpty(#ref(pvd1),#opts(id=cond,ver=1.2.3,desc="Some desc",labels=foo|bar,negateResult))
IsBlank
Template: *isBlank(<PolicyVariable|Reference>{1,1},#opts?)
Command starts with *isBlank
It contains exactly one parameter of type PolicyVariable or Reference
Supported options:
negateResult
- boolean, default value is null. Negates condition result
Minimal example:
*isBlank(#ref(pvd1))
Full example with options:
*isBlank(#ref(pvd1),#opts(id=cond,ver=1.2.3,desc="Some desc",labels=foo|bar,negateResult))
NotBlank
Template: *notBlank(<PolicyVariable|Reference>{1,1},#opts?)
Command starts with *isNull
It contains exactly one parameter of type PolicyVariable or Reference
Supported options:
negateResult
- boolean, default value is null. Negates condition result
Minimal example:
*notBlank(#ref(pvd1))
Full example with options:
*notBlank(#ref(pvd1),#opts(id=cond,ver=1.2.3,desc="Some desc",labels=foo|bar,negateResult))
StartsWith
Template: *sw(<PolicyVariable|Reference>{2,2},#opts?)
Command starts with *sw
It contains exactly two parameters of type PolicyVariable or Reference
Supported options:
negateResult
- boolean, default value is null. Negates condition resultstringIgnoreCase
- boolean, default value is null. Ignores casing when comparing stringsfieldsStrictCheck
- boolean, default value is null. Strict checking for object keysarrayOrderStrictCheck
- boolean, default value is null. Strict checking for array order
Minimal example:
*sw(#ref(pvd1), #ref(pvd2))
Full example with options:
*sw(#ref(pvd1), #ref(pvd2),#opts(id=cond,ver=1.2.3,desc="Some desc",labels=foo|bar,negateResult,stringIgnoreCase,fieldsStrictCheck,arrayOrderStrictCheck))
EndsWith
Template: *ew(<PolicyVariable|Reference>{2,2},#opts?)
Command starts with *ew
It contains exactly two parameters of type PolicyVariable or Reference
Supported options:
negateResult
- boolean, default value is null. Negates condition resultstringIgnoreCase
- boolean, default value is null. Ignores casing when comparing stringsfieldsStrictCheck
- boolean, default value is null. Strict checking for object keysarrayOrderStrictCheck
- boolean, default value is null. Strict checking for array order
Minimal example:
*ew(#ref(pvd1), #ref(pvd2))
Full example with options:
*ew(#ref(pvd1), #ref(pvd2),#opts(id=cond,ver=1.2.3,desc="Some desc",labels=foo|bar,negateResult,stringIgnoreCase,fieldsStrictCheck,arrayOrderStrictCheck))
Contains
Template: *contains(<PolicyVariable|Reference>{2,2},#opts?)
Command starts with *contains
It contains exactly two parameters of type PolicyVariable or Reference
Supported options:
negateResult
- boolean, default value is null. Negates condition resultstringIgnoreCase
- boolean, default value is null. Ignores casing when comparing stringsfieldsStrictCheck
- boolean, default value is null. Strict checking for object keysarrayOrderStrictCheck
- boolean, default value is null. Strict checking for array order
Minimal example:
*contains(#ref(pvd1), #ref(pvd2))
Full example with options:
*contains(#ref(pvd1), #ref(pvd2),#opts(id=cond,ver=1.2.3,desc="Some desc",labels=foo|bar,negateResult,stringIgnoreCase,fieldsStrictCheck,arrayOrderStrictCheck))
IsIn
Template: *isIn(<PolicyVariable|Reference>{2,2},#opts?)
Command starts with *isIn
It contains exactly two parameters of type PolicyVariable or Reference
Supported options:
negateResult
- boolean, default value is null. Negates condition resultstringIgnoreCase
- boolean, default value is null. Ignores casing when comparing stringsfieldsStrictCheck
- boolean, default value is null. Strict checking for object keysarrayOrderStrictCheck
- boolean, default value is null. Strict checking for array order
Minimal example:
*isIn(#ref(pvd1), #ref(pvd2))
Full example with options:
*isIn(#ref(pvd1), #ref(pvd2),#opts(id=cond,ver=1.2.3,desc="Some desc",labels=foo|bar,negateResult,stringIgnoreCase,fieldsStrictCheck,arrayOrderStrictCheck))
Equals
Template: *eq(<PolicyVariable|Reference>{2,2},#opts?)
Command starts with *eq
It contains exactly two parameters of type PolicyVariable or Reference
Supported options:
negateResult
- boolean, default value is null. Negates condition resultstringIgnoreCase
- boolean, default value is null. Ignores casing when comparing stringsfieldsStrictCheck
- boolean, default value is null. Strict checking for object keysarrayOrderStrictCheck
- boolean, default value is null. Strict checking for array order
Minimal example:
*eq(#ref(pvd1), #ref(pvd2))
Full example with options:
*eq(#ref(pvd1), #ref(pvd2),#opts(id=cond,ver=1.2.3,desc="Some desc",labels=foo|bar,negateResult,stringIgnoreCase,fieldsStrictCheck,arrayOrderStrictCheck))
Positive
Template: *pos(<PolicyVariable|Reference>{1,1},#opts?)
Command starts with *pos
It contains exactly one parameter of type PolicyVariable or Reference
Supported options:
negateResult
- boolean, default value is null. Negates condition result
Minimal example:
*pos(#ref(pvd1))
Full example with options:
*pos(#ref(pvd1),#opts(id=cond,ver=1.2.3,desc="Some desc",labels=foo|bar,negateResult))
Negative
Template: *neg(<PolicyVariable|Reference>{1,1},#opts?)
Command starts with *neg
It contains exactly one parameter of type PolicyVariable or Reference
Supported options:
negateResult
- boolean, default value is null. Negates condition result
Minimal example:
*neg(#ref(pvd1))
Full example with options:
*neg(#ref(pvd1),#opts(id=cond,ver=1.2.3,desc="Some desc",labels=foo|bar,negateResult))
Zero
Template: *zero(<PolicyVariable|Reference>{1,1},#opts?)
Command starts with *pos
It contains exactly one parameter of type PolicyVariable or Reference
Supported options:
negateResult
- boolean, default value is null. Negates condition result
Minimal example:
*zero(#ref(pvd1))
Full example with options:
*zero(#ref(pvd1),#opts(id=cond,ver=1.2.3,desc="Some desc",labels=foo|bar,negateResult))
Past
Template: *past(<PolicyVariable|Reference>{1,1},#opts?)
Command starts with *past
It contains exactly one parameter of type PolicyVariable or Reference
Supported options:
negateResult
- boolean, default value is null. Negates condition result
Minimal example:
*past(#ref(pvd1))
Full example with options:
*past(#ref(pvd1),#opts(id=cond,ver=1.2.3,desc="Some desc",labels=foo|bar,negateResult))
Future
Template: *future(<PolicyVariable|Reference>{1,1},#opts?)
Command starts with *future
It contains exactly one parameter of type PolicyVariable or Reference
Supported options:
negateResult
- boolean, default value is null. Negates condition result
Minimal example:
*future(#ref(pvd1))
Full example with options:
*future(#ref(pvd1),#opts(id=cond,ver=1.2.3,desc="Some desc",labels=foo|bar,negateResult))
Regexp
Template: *regexp(<PolicyVariable|Reference>{2,2},#opts?)
Command starts with *regexp
It contains exactly two parameters of type PolicyVariable or Reference
Supported options:
negateResult
- boolean, default value is null. Negates condition result
Minimal example:
*regexp(#ref(pvd1), #ref(pvd2))
Full example with options:
*regexp(#ref(pvd1), #ref(pvd2),#opts(id=cond,ver=1.2.3,desc="Some desc",labels=foo|bar,negateResult))
HasKey
Template: *hasKey(<PolicyVariable|Reference>{2,2},#opts?)
Command starts with *hasKey
It contains exactly two parameters of type PolicyVariable or Reference
Supported options:
negateResult
- boolean, default value is null. Negates condition result
Minimal example:
*hasKey(#ref(pvd1), #ref(pvd2))
Full example with options:
*hasKey(#ref(pvd1), #ref(pvd2),#opts(id=cond,ver=1.2.3,desc="Some desc",labels=foo|bar,negateResult))
Unique
Template: *unique(<PolicyVariable|Reference>{1,1},#opts?)
Command starts with *unique
It contains exactly one parameter of type PolicyVariable or Reference
Supported options:
negateResult
- boolean, default value is null. Negates condition result
Minimal example:
*unique(#ref(pvd1))
Full example with options:
*unique(#ref(pvd1),#opts(id=cond,ver=1.2.3,desc="Some desc",labels=foo|bar,negateResult))
Schema
Template: *schema(<PolicyVariable|Reference>{2,2},#opts?)
Command starts with *schema
It contains exactly two parameters of type PolicyVariable or Reference
Supported options:
negateResult
- boolean, default value is null. Negates condition result
Minimal example:
*schema(#ref(pvd1), #ref(pvd2))
Full example with options:
*schema(#ref(pvd1), #ref(pvd2),#opts(id=cond,ver=1.2.3,desc="Some desc",labels=foo|bar,negateResult))
PolicyConditionComposite
PolicyConditionComposite expressions can only contain PolicyCondition commands or references to PolicyConditions
Any
Template: *any(<PolicyCondition|Reference>{1,},#opts?)
Command starts with *any
It contains at least one parameter of type PolicyCondition or Reference
Supported options:
negateResult
- boolean, default value is null. Negates condition resultstrictCheck
- boolean, default value is null. Checks all conditions
Minimal example:
*any(#ref(pcr1,1.2.3),#ref(pcr2))
Full example with options:
*any(#ref(pcr1,1.2.3),#ref(pcr2),#opts(id=cond,ver=1.2.3,desc="Some desc",labels=foo|bar,negateResult,strictCheck))
All
Template: *all(<PolicyCondition|Reference>{1,},#opts?)
Command starts with *all
It contains at least one parameter of type PolicyCondition or Reference
Supported options:
negateResult
- boolean, default value is null. Negates condition resultstrictCheck
- boolean, default value is null. Checks all conditions
Minimal example:
*all(#ref(pcr1,1.2.3),#ref(pcr2))
Full example with options:
*all(#ref(pcr1,1.2.3),#ref(pcr2),#opts(id=cond,ver=1.2.3,desc="Some desc",labels=foo|bar,negateResult,strictCheck))
Not
Template: *not(<PolicyCondition|Reference>{1,1},#opts?)
Command starts with *all
It contains exactly one parameter of type PolicyCondition or Reference
Supported options:
negateResult
- boolean, default value is null. Negates condition result
Minimal example:
*not(#ref(pcr1,1.2.3))
Full example with options:
*not(#ref(pcr1,1.2.3),#opts(id=cond,ver=1.2.3,desc="Some desc",labels=foo|bar,negateResult))
NOf
Template: *nOf(<PolicyCondition|Reference>{1,},#opts)
Command starts with *nOf
It contains at least one parameter of type PolicyCondition or Reference
Supported options:
minimumConditions
- Mandatory Int, no default value. Defines minimum number of conditions that should resolve to truenegateResult
- boolean, default value is null. Negates condition resultstrictCheck
- boolean, default value is null. Checks all conditionsoptimize
- boolean, default value is null. Runs check in optimized manner
Minimal example:
*nOf(#ref(pcr1,1.2.3),#ref(pcr2),#opts(minimumConditions=1))
Full example with options:
*nOf(#ref(pcr1,1.2.3),#ref(pcr2),#opts(minimumConditions=1,id=cond,ver=1.2.3,desc="Some desc",labels=foo|bar,negateResult,strictCheck,optimize))
PolicyConditionDefault
PolicyConditionDefault expressions are without parameters or options
True
Template: #true(<>{0,0})
Command starts with #true
It cannot contain any parameter
Supported options:
- none
Example:
#true()
False
Template: #false(<>{0,0})
Command starts with #false
It cannot contain any parameter
Supported options:
- none
Example:
#false()
Null
Template: #null(<>{0,0})
Command starts with #null
It cannot contain any parameter
Supported options:
- none
Example:
#null()