Closed kevinrademan closed 6 years ago
I would say not implemented.
After a serious deep dive into the authentication mechanisms around the bulk import, I managed to figure out that it was simply a configuration setting.
There is a setting called "is_user_authenticated" which gets used in the following file. https://github.com/akeneo/pim-community-dev/blob/2.3/src/Pim/Bundle/ConnectorBundle/EventListener/JobExecutionAuthenticator.php#L66
This flag is per default set to false and I haven't really seen any examples of job fixtures where it gets set to true, BUT it looks like any other setting so im sure you could set it.
In my case, I fixed up my existing job using a quick and dirty sql query
update akeneo_batch_job_instance set raw_parameters = REPLACE(raw_parameters, 'is_user_authenticated\";b:0', 'is_user_authenticated\";b:1') where code = 'csv_attribute_value_map_import';
Just a question about the expected behavior. I have set up a post-save event on one of my reference data entities which uses the Akeneo\Bundle\BatchQueueBundle\Launcher\QueueJobLauncher to launch an asynchronous job,
In my postSave event, I use the token storage to get the current user, which is then passed into the QueueJobLanuncher. My intention is that the spawned job, should run in the users' context so that the activity view for that job shows on the UI.
I've however discovered that the bulk import for the reference data entities appears to be executing with the "system" user instead of the original user who started the job.
Is this behavior intentional or just not implemented?