How to work with external mysql datasources and ACL

Hi,

I am trying to add a custom filter to an external mysql datasource. For this I am developing a custom plugin. So far I have tried using:

  • ACL
  • ctx.action.mergeParams

I am using an external datasources (using the data-source-external-mysql plugin).
As I found out, using (this.app.acl.use) does not get triggered by default for externally accessed collections, so this does not work.

Next I tried to use this.app.use function (as this DOES gets triggered when accessing the external datasource):
This does LOOK like it adds the filter, but the filter does not get executed no matter how easy of what filter I try.

Any pointers on how can I add a custom programmed filter to an external datasource?

Thanks!

I was able to make this work using the built-in data-source permissions; I wasn’t however able tom make it work using a custom plugin.
Every combination I tried of using:
mergeParams, … I couldn’t find the correct hook timing to be executed before my query was executed + having the right context attached to the ctx object. It always ran after the query was executed OR I did not have the right ctx to execute the functions.

I guess this is possible, I just haven’t figured it out.