def _get_aggregates(self): """Get all aggregates that can be used by the slice (i.e. for which the slice has the "can_use_aggregate" permission). """ agg_ids = [] agg_classes = get_aggregate_classes() permittee = Permittee.objects.get_as_permittee(self) for agg_class in agg_classes: agg_ids.extend( ObjectPermission.objects.filter_for_class( agg_class, permission__name="can_use_aggregate", permittees=permittee, ).values_list("object_id", flat=True)) return Aggregate.objects.filter(pk__in=agg_ids)
def _get_aggregates(self): """Get all aggregates that can be used by the slice (i.e. for which the slice has the "can_use_aggregate" permission). """ agg_ids = [] agg_classes = get_aggregate_classes() permittee = Permittee.objects.get_as_permittee(self) for agg_class in agg_classes: agg_ids.extend( ObjectPermission.objects.filter_for_class( agg_class, permission__name="can_use_aggregate", permittees=permittee, ).values_list("object_id", flat=True) ) return Aggregate.objects.filter(pk__in=agg_ids)
def _get_aggregates(self): """Get all aggregates that can be used by the project (i.e. for which the project has the "can_use_aggregate" permission). """ # Permissions are given to the leaf classes agg_ids = [] agg_classes = get_aggregate_classes() permittee = Permittee.objects.get_as_permittee(self) for agg_class in agg_classes: agg_ids.extend( ObjectPermission.objects.filter_for_class( agg_class, permission__name="can_use_aggregate", permittees=permittee, ).values_list("object_id", flat=True)) #TODO: marc comented this return Aggregate.objects.filter(pk__in=agg_ids)
def _get_aggregates(self): """Get all aggregates that can be used by the project (i.e. for which the project has the "can_use_aggregate" permission). """ # Permissions are given to the leaf classes agg_ids = [] agg_classes = get_aggregate_classes() permittee = Permittee.objects.get_as_permittee(self) for agg_class in agg_classes: agg_ids.extend( ObjectPermission.objects.filter_for_class( agg_class, permission__name="can_use_aggregate", permittees=permittee, ).values_list("object_id", flat=True) ) #TODO: marc comented this return Aggregate.objects.filter(pk__in=agg_ids)