Wrapper to execute code only for logged in users.