I have just found out that if I try to fetch a User inside my plugin by calling UserModel#findUserById() and then call getEmail() method on the instance, I will get an access denied exception in case I am logged in as a normal user (it works fine for admin users though). I can call getters for id or name without any problem but the email getter is somehow restricted inside.
Is there any way how to avoid that exception and get email of the user?
Thank you in advance for any help!
- Jan Pfeffer