Skip to content

Commit cbf3f34

Browse files
update list filters to support save view in prism
do not skip if query string is empty update user access to the dataset instead of query string for filters
1 parent caa9604 commit cbf3f34

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/users/filters.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -185,18 +185,18 @@ impl Filters {
185185
let query = if let Some(q) = &f.query.filter_query {
186186
q
187187
} else {
188-
continue;
188+
&String::default()
189189
};
190190
let filter_type = &f.query.filter_type;
191191

192192
// if filter type is one of SQL or filter
193193
// then check if the user has access to the dataset based on the query string
194194
// if filter type is search then check if the user has access to the dataset based on the dataset name
195-
if *filter_type == FilterType::SQL || *filter_type == FilterType::Filter {
195+
if *filter_type == FilterType::SQL {
196196
if (user_auth_for_query(key, query).await).is_ok() {
197197
filters.push(f.clone())
198198
}
199-
} else if *filter_type == FilterType::Search {
199+
} else if *filter_type == FilterType::Search || *filter_type == FilterType::Filter {
200200
let dataset_name = &f.stream_name;
201201
let permissions = Users.get_permissions(key);
202202
if user_auth_for_datasets(&permissions, &[dataset_name.to_string()]).is_ok() {

0 commit comments

Comments
 (0)