Check if user id is listed under badge

Hi!! I had to get rid of

function get_UserData() {

because it was not causing the console logs to not show up.
And for user.getRoles(), it says I’m now allowed to use it in preview mode. Is there a preview friendly alternative or should I wait to publish it and then use user.getRoles?