Skip to content

Commit 2ec90d7

Browse files
refactor
1 parent 7bce091 commit 2ec90d7

File tree

1 file changed

+2
-7
lines changed

1 file changed

+2
-7
lines changed

src/users/filters.rs

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -180,13 +180,9 @@ impl Filters {
180180
let read = self.0.read().await;
181181

182182
let mut filters = Vec::new();
183-
183+
let permissions = Users.get_permissions(key);
184184
for f in read.iter() {
185-
let query = if let Some(q) = &f.query.filter_query {
186-
q
187-
} else {
188-
&String::default()
189-
};
185+
let query: &str = f.query.filter_query.as_deref().unwrap_or("");
190186
let filter_type = &f.query.filter_type;
191187

192188
// if filter type is SQL, check if the user has access to the dataset based on the query string
@@ -197,7 +193,6 @@ impl Filters {
197193
}
198194
} else if *filter_type == FilterType::Search || *filter_type == FilterType::Filter {
199195
let dataset_name = &f.stream_name;
200-
let permissions = Users.get_permissions(key);
201196
if user_auth_for_datasets(&permissions, &[dataset_name.to_string()]).is_ok() {
202197
filters.push(f.clone())
203198
}

0 commit comments

Comments
 (0)