diff --git a/pkg/models/task_collection_filter.go b/pkg/models/task_collection_filter.go index 21e3f52e2..7069a70b1 100644 --- a/pkg/models/task_collection_filter.go +++ b/pkg/models/task_collection_filter.go @@ -150,6 +150,8 @@ func getTaskFiltersByCollections(c *TaskCollection) (filters []*taskFilter, err return } + c.Filter = strings.ReplaceAll(c.Filter, " in ", " ?= ") + parsedFilter, err := fexpr.Parse(c.Filter) if err != nil { return nil, &ErrInvalidFilterExpression{ diff --git a/pkg/models/task_collection_test.go b/pkg/models/task_collection_test.go index 6185888c8..9b1c95134 100644 --- a/pkg/models/task_collection_test.go +++ b/pkg/models/task_collection_test.go @@ -1032,10 +1032,22 @@ func TestTaskCollection_ReadAll(t *testing.T) { }, wantErr: false, }, + { + name: "filter in keyword", + fields: fields{ + Filter: "id in '1,2,34'", // user does not have permission to access task 34 + }, + args: defaultArgs, + want: []*Task{ + task1, + task2, + }, + wantErr: false, + }, { name: "filter in", fields: fields{ - Filter: "id ?= '1,2,34'", + Filter: "id ?= '1,2,34'", // user does not have permission to access task 34 }, args: defaultArgs, want: []*Task{