File tree Expand file tree Collapse file tree 2 files changed +10
-12
lines changed
metrics/data/managers/core_models Expand file tree Collapse file tree 2 files changed +10
-12
lines changed Original file line number Diff line number Diff line change 1313from django .db .models .query_utils import Q
1414from django .utils import timezone
1515
16+ from metrics .api .permissions .fluent_permissions import validate_permissions_for_non_public
1617from metrics .data .models import RBACPermission
1718
1819ALLOWABLE_METRIC_VALUE_RANGE_TYPE = tuple [str | float | int , str | float | int ]
@@ -603,18 +604,15 @@ def query_for_data(
603604
604605 """
605606 rbac_permissions : Iterable [RBACPermission ] = rbac_permissions or []
606- has_access_to_non_public_data : bool = (
607- True # TODO: Remove this - manually set for caching testing
607+ has_access_to_non_public_data : bool = validate_permissions_for_non_public (
608+ theme = theme ,
609+ sub_theme = sub_theme ,
610+ topic = topic ,
611+ metric = metric ,
612+ geography_type = geography_type ,
613+ geography = geography ,
614+ rbac_permissions = rbac_permissions ,
608615 )
609- # has_access_to_non_public_data: bool = validate_permissions_for_non_public(
610- # theme=theme,
611- # sub_theme=sub_theme,
612- # topic=topic,
613- # metric=metric,
614- # geography_type=geography_type,
615- # geography=geography,
616- # rbac_permissions=rbac_permissions,
617- # )
618616
619617 return self .get_queryset ().query_for_data (
620618 fields_to_export = fields_to_export ,
Original file line number Diff line number Diff line change @@ -78,7 +78,7 @@ def get_queryset(self) -> "APITimeSeriesQuerySet":
7878 """
7979 kwargs : dict [str , str ] = self .get_kwargs_from_request ()
8080 return self .api_time_series_manager .get_distinct_column_values_with_filters (
81- lookup_field = self .lookup_field , restrict_to_public = False , ** kwargs
81+ lookup_field = self .lookup_field , restrict_to_public = True , ** kwargs
8282 )
8383
8484 def build_timeseries_dto_slice (self ) -> list [APITimeSeriesDTO ]:
You can’t perform that action at this time.
0 commit comments