I've built a plugin for Microsoft Dynamics CRM 2013 Online platform. The plugin is registered at Delete of my_custom_entity. It is synchronous and post-operational. Impersonation is set to Calling user. As far as I know the plugin should be fired with the calling user's privileges etc. with these settings.
I can't figure out why, but my the plugin is always run under "SYSTEM" user. I've tried to use two different system users with no luck whatsoever. It's kind of a problem because my plugin is calling a workflow and the workflow is sending an email. SYSTEM user can't send emails though.
Is this something new in CRM 2013? I tried to Google but couldn't find anything relevant. I already tried to unregister and register my plugin assembly again. No difference.
How can I change my plugin registration so that it would run on behalf of a user who fires the plugin (who deletes an entity).
Thank you