Allow the injected filter for authenticated embedding to be injected as the first filter in pipeline
When you embed a chart with authenticated access you have the option to inject a function that returns a MongoDB Query to be injected as a filter on the chart. In this function you have access to the context object which provides info about the current user (token), this gives you the ability to filter the data per tenant in case of multi-tenant applications, but since this filter is only applied as chart filter and not as filter in the aggregation pipeline of the chart or as filter in the view used by the chart, it's really difficult to hit multi-tenant indexes (indexes that have the tenant id as a prefix) especially if the chart requires data processing in its pipeline. Provide the ability to select where this injected filter is applied for example as the first step in the aggregation pipeline of the chart, as a filter in the view that is used by the chart or as is now.
![](https://secure.gravatar.com/avatar/713de9db50ce91549d74d03246da3e86?size=40&default=https%3A%2F%2Fassets.uvcdn.com%2Fpkg%2Fadmin%2Ficons%2Fuser_70-6bcf9e08938533adb9bac95c3e487cb2a6d4a32f890ca6fdc82e3072e0ea0368.png)