How should I save custom values for a Backoffice User

Hi,

I’d like to be able to save some additional values for backoffice users (code access, don’t need UI).

Is there any sort of property bag I could use?

How mean “don’t need UI”?

It’s values that I would read/write from code, they don’t need to be visible/editable in the backoffice (its also ok if they are)

Any values you can see in the UI in the Users section can be set by code, there are no custom properties you can add to users though. So if you want to store something like “job title” for an Umbraco backoffice user, you could store that in a new custom database table that you make yourself.

In v15 there is the UserdataService (you would use IUserDataService in your code). which i think has been revived to make storing data for user tours etc, more generic.

this lets you store key/value pairs against a user, I don’t think there are any reasons why you couldn’t use it for your own data.

5 Likes

Little did I know! :+1: