Hi there, we don't yet officially support plugin development, so I won't be able to fully answer your question. However, there's some info available at How to get currently logged in USERID in plugin? which looks relevant and might be able to help you.
Thanks,
CJ