I have...
- List of tasks tagged with "must match" labels.
- User tagged with labels. Now I want to filter only the tasks that match all task-tags with user-tags(user may have extra tags).
// rego-input:
{"
user":"user-1",
"tags":{"loc":"NY","type":"L1","group":"admin"}
}
// rego-data:
{
"proj":"abc1",
"tasks":[
{"tags":{"loc":"NJ","type":"L1"},"title":"task-1"},
{"tags":{"loc":"NY","type":"L1"},"title":"task-2"},
{"tags":{"loc":"PA","type":"L2"},"title":"task-3"}]
}
// expected rego-output:
{
"user":"user-1",
"tasks":[
{"tags":{"loc":"NY","type":"L1"},"title":"task-2"}
]
}
What is the right rego to get above output?, appreciate the inputs.