What is the best method to add a string attribute to a System User?

I want to add a custom string attribute for a System User. I saw the UserExt Avatar example here and I’m sure this will work but is there a simpler way?

Specifically would it be possible to modify the System User entity directly and if so is that recommended or is it better to use the UserExt method?

Hi,

there are basically three ways to add additional information to the user entity.

  1. Extend the user entity (see the docs)
  2. Create a explicit Entity like “Employee” with your business data with a Many-to-one association to the User (like described here)
  3. create dynamic attributes for the User entity (see the docs)

I hope this helps.

Bye
Mario

Hi,

Also, there is a good example of such an extension - https://github.com/cuba-platform/sample-user-avatar There we extend User entity and add additional property to store avatar image.

Thank you both for the speedy reply.