Class BackOfficeIdentityUser
The identity user used for the back office
Namespace: Umbraco.Cms.Core.Security
Assembly: Umbraco.Infrastructure.dll
Syntax
public class BackOfficeIdentityUser : UmbracoIdentityUser, IRememberBeingDirty, ICanBeDirty
Constructors
View SourceBackOfficeIdentityUser(GlobalSettings, int, IEnumerable<IReadOnlyUserGroup>)
Initializes a new instance of the BackOfficeIdentityUser class.
Declaration
public BackOfficeIdentityUser(GlobalSettings globalSettings, int userId, IEnumerable<IReadOnlyUserGroup> groups)
Parameters
| Type | Name | Description |
|---|---|---|
| GlobalSettings | globalSettings | |
| int | userId | |
| IEnumerable<IReadOnlyUserGroup> | groups |
Properties
View SourceAllowedSections
Gets a readonly list of the user's allowed sections which are based on it's user groups
Declaration
public string[] AllowedSections { get; }
Property Value
| Type | Description |
|---|---|
| string[] |
CalculatedContentStartNodeIds
Gets or sets the set of content start node IDs that have been calculated for this back office identity user, typically based on their group memberships and permissions. These IDs determine the root content nodes the user can access in the back office.
Declaration
public int[]? CalculatedContentStartNodeIds { get; set; }
Property Value
| Type | Description |
|---|---|
| int[] |
CalculatedMediaStartNodeIds
Gets or sets the calculated media start node IDs for the back office identity user. These IDs represent the root media nodes that the user has access to, typically determined by user group permissions or configuration.
Declaration
public int[]? CalculatedMediaStartNodeIds { get; set; }
Property Value
| Type | Description |
|---|---|
| int[] |
Culture
Gets or sets the culture
Declaration
public string Culture { get; set; }
Property Value
| Type | Description |
|---|---|
| string |
InviteDate
Gets or sets invite date
Declaration
public DateTime? InviteDate { get; set; }
Property Value
| Type | Description |
|---|---|
| DateTime? |
Key
Gets or sets the unique key that identifies the back office identity user.
Declaration
public Guid Key { get; set; }
Property Value
| Type | Description |
|---|---|
| Guid |
Kind
Gets or sets the classification of the back office user, indicating the user's type or role within the system.
Declaration
public UserKind Kind { get; set; }
Property Value
| Type | Description |
|---|---|
| UserKind |
StartContentIds
Gets or sets content start nodes assigned to the User (not ones assigned to the user's groups)
Declaration
public int[] StartContentIds { get; set; }
Property Value
| Type | Description |
|---|---|
| int[] |
StartMediaIds
Gets or sets media start nodes assigned to the User (not ones assigned to the user's groups)
Declaration
public int[] StartMediaIds { get; set; }
Property Value
| Type | Description |
|---|---|
| int[] |
Methods
View SourceCreateNew(GlobalSettings, string?, string, string, string?, Guid?, UserKind)
Creates a new BackOfficeIdentityUser instance without an identity, for use before the user is persisted.
Declaration
public static BackOfficeIdentityUser CreateNew(GlobalSettings globalSettings, string? username, string email, string culture, string? name = null, Guid? id = null, UserKind kind = UserKind.Default)
Parameters
| Type | Name | Description |
|---|---|---|
| GlobalSettings | globalSettings | The global settings used to initialize the user instance. |
| string | username | The username for the new user. Cannot be null or whitespace. |
| string | The email address for the user. This can be null, but must be set before persisting the user. |
|
| string | culture | The culture assigned to the user. Cannot be null or whitespace. |
| string | name | The display name of the user. Optional. |
| Guid? | id | The unique identifier for the user. Optional; if not provided, a new one will be generated. |
| UserKind | kind | The kind of user. Optional; defaults to Default. |
Returns
| Type | Description |
|---|---|
| BackOfficeIdentityUser | A new instance of BackOfficeIdentityUser without an identity. |
SetGroups(IReadOnlyCollection<IReadOnlyUserGroup>)
Sets the user groups for the backoffice identity user and updates related roles.
Declaration
public void SetGroups(IReadOnlyCollection<IReadOnlyUserGroup> value)
Parameters
| Type | Name | Description |
|---|---|---|
| IReadOnlyCollection<IReadOnlyUserGroup> | value | The collection of user groups to assign to the user. |