Roles code not working

The result of user.getRoles() is an array and you can’t assign an array to text elements. Only strings can be assigned to text elements.