Interface IUser
Defines the interface for a User
Namespace: Umbraco.Cms.Core.Models.Membership
Assembly: Umbraco.Core.dll
Syntax
public interface IUser : IMembershipUser, IEntity, IDeepCloneable, IRememberBeingDirty, ICanBeDirty
Remarks
Will be left internal until a proper Membership implementation is part of the roadmap
Properties
View SourceAllowedSections
Gets the collection of section aliases that this user has access to.
Declaration
IEnumerable<string> AllowedSections { get; }
Property Value
| Type | Description |
|---|---|
| IEnumerable<string> |
Avatar
Will hold the media file system relative path of the users custom avatar if they uploaded one
Declaration
string? Avatar { get; set; }
Property Value
| Type | Description |
|---|---|
| string |
Groups
Gets the groups that user is part of
Declaration
IEnumerable<IReadOnlyUserGroup> Groups { get; }
Property Value
| Type | Description |
|---|---|
| IEnumerable<IReadOnlyUserGroup> |
InvitedDate
Gets or sets the date and time when the user was invited.
Declaration
DateTime? InvitedDate { get; set; }
Property Value
| Type | Description |
|---|---|
| DateTime? |
Kind
The type of user.
Declaration
UserKind Kind { get; set; }
Property Value
| Type | Description |
|---|---|
| UserKind |
Language
Gets or sets the preferred language for the user's backoffice UI.
Declaration
string? Language { get; set; }
Property Value
| Type | Description |
|---|---|
| string |
Name
Gets or sets the display name of the user.
Declaration
string? Name { get; set; }
Property Value
| Type | Description |
|---|---|
| string |
ProfileData
Exposes the basic profile data
Declaration
IProfile ProfileData { get; }
Property Value
| Type | Description |
|---|---|
| IProfile |
SessionTimeout
Gets or sets the session timeout in minutes.
Declaration
int SessionTimeout { get; set; }
Property Value
| Type | Description |
|---|---|
| int |
StartContentIds
Gets or sets the starting content node identifiers for this user.
Declaration
int[]? StartContentIds { get; set; }
Property Value
| Type | Description |
|---|---|
| int[] |
StartMediaIds
Gets or sets the starting media node identifiers for this user.
Declaration
int[]? StartMediaIds { get; set; }
Property Value
| Type | Description |
|---|---|
| int[] |
UserState
Gets the current state of the user.
Declaration
UserState UserState { get; }
Property Value
| Type | Description |
|---|---|
| UserState |
Methods
View SourceAddGroup(IReadOnlyUserGroup)
Adds the user to the specified group.
Declaration
void AddGroup(IReadOnlyUserGroup group)
Parameters
| Type | Name | Description |
|---|---|---|
| IReadOnlyUserGroup | group | The group to add the user to. |
ClearGroups()
Removes the user from all groups.
Declaration
void ClearGroups()
RemoveGroup(string)
Removes the user from the specified group.
Declaration
void RemoveGroup(string group)
Parameters
| Type | Name | Description |
|---|---|---|
| string | group | The alias of the group to remove the user from. |