Gizra / message_notify

https://www.drupal.org/project/message_notify
11 stars 17 forks source link

Switch user prior to rendering/sending messages #66

Open jhedstrom opened 6 years ago

jhedstrom commented 6 years ago

When access control of some sort (field permissions for instance) and messages are sent via cron (or queue workers, etc), certain fields can be hidden from recipients since cron is run as anonymous (Drush 9 removes the --user option).

In the base notifier plugin, prior to rendering the message, it would be good to switch to the recipient account. This is non-trivial as it will involve an API change to the constructor to properly inject the AccountSwitcher service.