File tree Expand file tree Collapse file tree 1 file changed +6
-12
lines changed Expand file tree Collapse file tree 1 file changed +6
-12
lines changed Original file line number Diff line number Diff line change @@ -180,25 +180,19 @@ 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- continue ;
189- } ;
185+ let query: & str = f. query . filter_query . as_deref ( ) . unwrap_or ( "" ) ;
190186 let filter_type = & f. query . filter_type ;
191187
192- // if filter type is one of SQL or filter
193- // then check if the user has access to the dataset based on the query string
194- // 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 {
188+ // if filter type is SQL, check if the user has access to the dataset based on the query string
189+ // if filter type is search or filter, check if the user has access to the dataset based on the dataset name
190+ if * filter_type == FilterType :: SQL {
196191 if ( user_auth_for_query ( key, query) . await ) . is_ok ( ) {
197192 filters. push ( f. clone ( ) )
198193 }
199- } else if * filter_type == FilterType :: Search {
194+ } else if * filter_type == FilterType :: Search || * filter_type == FilterType :: Filter {
200195 let dataset_name = & f. stream_name ;
201- let permissions = Users . get_permissions ( key) ;
202196 if user_auth_for_datasets ( & permissions, & [ dataset_name. to_string ( ) ] ) . is_ok ( ) {
203197 filters. push ( f. clone ( ) )
204198 }
You can’t perform that action at this time.
0 commit comments