Configuring conditions
Conditions can be used to further specify the policy on an element in Valtimo. When a condition is used in the policy it will match the conditions against the element it is trying to access. If the element matches the conditions it will be loaded, if a condition fails it will not be loaded.
Use case
Use case: An implementation has 5 case types. 2 of those 5 case types should only be accessible to managers.
Solution:
Give the managers
ROLE_MANAGER.Configure with conditions in PBAC that only
ROLE_MANAGERcan view these cases based on their Case Definition Name.Users without
ROLE_MANAGERwill no longer be able to view the 2 cases in Valtimo.
Supported conditions
The following conditions can be used with their respective structures:
container
Allows more complex conditions by denoting the related entity the nested conditions should apply to.
Field
type
The type of condition. In this case field.
field
field
The field the value should be compared against.
assigneeId, documentDefinitionId.name
operator
The operator for the comparison.
==, <
value
The value to compare the field against.
20000, ${currentUserId}
Expression
type
The type of condition. In this case expression.
expression
field
The field used to start the path from.
content.content
path
The path that points to the field to compare to.
$.height
operator
The operator for the comparison.
==, <
value
The value to compare the field against.
20000, ${currentUserId}
clazz
The name of the class that is found at the path.
java.lang.Integer
Container
type
The type of condition. In this case container.
container
resourceType
The related resource type the conditions should apply to.
com.ritense.document.domain.impl.JsonSchemaDocument
Operators
==
Equal to.
!=
Not equal to.
>
Greater than.
>=
Greater than or equal to.
<
Smaller than.
<=
Smaller than or equal to.
list_contains
Checks if a collection contains the given value.
in
Checks if a value is contained in the given collection.
Special values for the value field
${currentUserId}
The identifier assigned to the current user.
${currentUserEmail}
The email address the current user has.
${currentUserRoles}
The list of roles the current user has.
Examples
Below a number of examples of applying conditions in Access control policies.
Last updated