Table of Contents

Class LimitedUser

Namespace
Dynamicweb.Security.UserManagement
Assembly
Dynamicweb.Security.dll
Represents a limited user, that can be used for authentication, without loading unneeded data from dependencies, database and context.
[Serializable]
public class LimitedUser : DbObject, IPermissionLookup, IPermissionCustomAncestors, IPermissionControlled
Inheritance
LimitedUser
Implements
Inherited Members
Extension Methods

Constructors

LimitedUser()

Creates a new instance of a class.
public LimitedUser()

LimitedUser(string)

Creates a new instance of a class.
public LimitedUser(string userName)

Parameters

userName string
Initial user-name to be assigned to the user.

Fields

ImportedUserID

public const int ImportedUserID = -2

Field Value

int

ImportedUserName

public const string ImportedUserName = "import"

Field Value

string

NotLoggedInFrontendUserName

public const string NotLoggedInFrontendUserName = "frontend"

Field Value

string

Properties

Active

Gets or sets value indicating whether user is active.
[AddInName("Active")]
public bool Active { get; set; }

Property Value

bool
Value indicating whether user is active.

Address

Gets or sets user's primary address.
[AddInName("Address")]
[AddInIsEditable(true)]
public string Address { get; set; }

Property Value

string
User's primary address.

Address2

Gets or sets user's secondary address.
[AddInName("Address2")]
[AddInIsEditable(true)]
public string Address2 { get; set; }

Property Value

string
User's secondary address.

Addresses

Gets user's addresses
public IEnumerable<UserAddress> Addresses { get; }

Property Value

IEnumerable<UserAddress>
User's addresses.

AddressTitle

Gets or sets user address title.
[AddInName("AddressTitle")]
[AddInIsEditable(true)]
public string AddressTitle { get; set; }

Property Value

string
User address title.

AdministratorInGroups

Gets the collection of groups where the current user is administrator.
public ReadOnlyGroupCollection AdministratorInGroups { get; }

Property Value

ReadOnlyGroupCollection
The collection of groups where the current user is administrator. The collection is read-only.

AdministratorInGroupsIDs

Gets the collection of group IDs where the current user is administrator.
[Obsolete("Use GroupsIdsUserIsAdmin instead")]
public ICollection<int> AdministratorInGroupsIDs { get; }

Property Value

ICollection<int>
The collection of group IDs where the current user is administrator.

AllowBackend

Gets or sets allow backend property value
public bool AllowBackend { get; set; }

Property Value

bool

AllowBackendWithInheritance

Shows if backed access granted to current user
[AddInName("AllowBackend")]
public bool AllowBackendWithInheritance { get; }

Property Value

bool
True or false

ApprovalKey

Gets or sets approval key
public string ApprovalKey { get; set; }

Property Value

string

CanEditPermissions

Sows if user can edit permissions
public bool CanEditPermissions { get; }

Property Value

bool
True or false

City

Gets or sets user's city.
[AddInName("City")]
[AddInIsEditable(true)]
public string City { get; set; }

Property Value

string
User's city.

Company

Gets or sets user's company name.
[AddInName("Company")]
[AddInIsEditable(true)]
public string Company { get; set; }

Property Value

string
User's company name.

ConfigurationID

Gets or sets user's editor configuration ID.
[AddInName("ConfigurationID")]
public int ConfigurationID { get; set; }

Property Value

int
User's editor configuration ID.

Country

Gets or sets user's country.
[AddInName("Country")]
[AddInIsEditable(true)]
public string Country { get; set; }

Property Value

string
User's country.

CountryCode

Gets or sets user's country code
[AddInName("CountryCode")]
[AddInIsEditable(true)]
public string CountryCode { get; set; }

Property Value

string

Culture

Gets user culture
[Obsolete("Use ExecutingContext.GetCulture instead.", true)]
public CultureInfo Culture { get; }

Property Value

CultureInfo
CultureInfo

Currency

Gets or sets user's currency name.
[AddInName("Currency")]
public string Currency { get; set; }

Property Value

string
User's currency name.

CustomerNumber

Gets or sets user's customer number.
[AddInName("CustomerNumber")]
public string CustomerNumber { get; set; }

Property Value

string
User's customer number.

DecryptedPassword

Gets or sets the plain password.
public string DecryptedPassword { get; set; }

Property Value

string

Department

Gets or sets user's department name.
[AddInName("Department")]
[AddInIsEditable(true)]
public string Department { get; set; }

Property Value

string
User's department name.

Email

Gets or sets user's e-mail address.
[AddInName("Email")]
[AddInIsEditable(true)]
public string Email { get; set; }

Property Value

string
User's e-mail address.

Exported

Gets or sets user last exported date
public DateTime? Exported { get; set; }

Property Value

DateTime?

ExternalID

Get or sets user's external id.
[AddInName("ExternalId")]
[AddInIsEditable(true)]
public string ExternalID { get; set; }

Property Value

string
external user's id (if any)

ExternalLogins

Gets the external logins associated with the user
[Obsolete("Use ExternalLogOns instead")]
public IEnumerable<ExternalLogin> ExternalLogins { get; }

Property Value

IEnumerable<ExternalLogin>
The collection is read-only.

ExternalLogOns

Gets the external logins associated with the user
public IEnumerable<ExternalLogin> ExternalLogOns { get; }

Property Value

IEnumerable<ExternalLogin>
The collection is read-only.

Fax

Gets or sets user's fax number
[AddInName("Fax")]
[AddInIsEditable(true)]
public string Fax { get; set; }

Property Value

string
User's fax number.

FirstName

Gets or sets user's first name.
[AddInName("FirstName")]
[AddInIsEditable(true)]
public string FirstName { get; set; }

Property Value

string
User's first name.

FrontendStartPage

Gets or sets the page that the user is redirected to on login
[AddInName("StartPage")]
[AddInIsEditable(false)]
public string FrontendStartPage { get; set; }

Property Value

string
String value

GeoLocationHash

Gets or sets geo location hash value
[AddInName("GeoLocationHash")]
[Obsolete("Use GeolocationHashCode instead")]
public string GeoLocationHash { get; set; }

Property Value

string
String value

GeolocationHashCode

Gets or sets geo location hash value
[AddInName("GeolocationHashCode")]
public string GeolocationHashCode { get; set; }

Property Value

string
String value

GeolocationIcon

Gets or sets geo location image
[AddInName("GeolocationIcon")]
public string GeolocationIcon { get; set; }

Property Value

string

GeoLocationImage

Gets or sets geo location image
[AddInName("GeoLocationImage")]
[Obsolete("Use GeolocationIcon instead")]
public string GeoLocationImage { get; set; }

Property Value

string

GeoLocationIsCustom

Gets or sets "Geo location is custom" sign
[Obsolete("Use IsGeolocationCustom instead.")]
public bool GeoLocationIsCustom { get; set; }

Property Value

bool

GeoLocationLat

Gets geo location latitude
[Obsolete("Use GeolocationLatitude instead")]
[AddInName("GeoLocationLat")]
public double GeoLocationLat { get; set; }

Property Value

double
Double value

GeolocationLatitude

Gets geo location latitude
[AddInName("GeolocationLatitude")]
public double GeolocationLatitude { get; set; }

Property Value

double
Double value

GeoLocationLng

Gets or sets GeoLocation longitude
[Obsolete("Use GeolocationLongitude instead")]
[AddInName("GeoLocationLng")]
public double GeoLocationLng { get; set; }

Property Value

double
Double value

GeolocationLongitude

Gets geo location longitude
[AddInName("GeolocationLongitude")]
public double GeolocationLongitude { get; set; }

Property Value

double
Double value

GroupIDs

[Obsolete("Use GroupsIds instead")]
public ICollection<int> GroupIDs { get; }

Property Value

ICollection<int>

Groups

Gets user's groups. The collection is read-only.
public ReadOnlyGroupCollection Groups { get; }

Property Value

ReadOnlyGroupCollection
User's groups. The collection is read-only.

GroupsCount

Gets the number of groups that current user is attached to.
public int GroupsCount { get; }

Property Value

int
The number of groups.

GroupsHaveChanged

Shows if groups of user have been changed
public bool GroupsHaveChanged { get; }

Property Value

bool
True or false

GroupsIds

public ICollection<int> GroupsIds { get; }

Property Value

ICollection<int>

GroupsIdsUserIsAdmin

Gets the collection of group IDs where the current user is administrator.
public ICollection<int> GroupsIdsUserIsAdmin { get; }

Property Value

ICollection<int>
The collection of group IDs where the current user is administrator.

HouseNumber

Gets or sets user's house number.
[AddInName("HouseNumber")]
[AddInIsEditable(true)]
public string HouseNumber { get; set; }

Property Value

string
User's house number.

ID

Gets or sets user's ID.
[AddInName("ID")]
public int ID { get; set; }

Property Value

int
User's ID.

Image

Gets or sets path to the user's image.
public string Image { get; set; }

Property Value

string
Path to the user's image.

InformationSentDate

Gets the last date when user information was sent to the user.
public DateTime? InformationSentDate { get; }

Property Value

DateTime?

IsAdmin

Returns true if this user is Admin or Administrator
public bool IsAdmin { get; }

Property Value

bool

IsAngel

Gets or sets value indicating whether current user's type is "Angel".
public bool IsAngel { get; }

Property Value

bool
Value indicating whether current user's type is "Angel".

IsBuiltInAdmin

Returns true if this user is built-in Admin or Administrator
public bool IsBuiltInAdmin { get; }

Property Value

bool

IsGeolocationCustom

Gets or sets "Geo location is custom" sign
public bool IsGeolocationCustom { get; set; }

Property Value

bool

IsLivePricesDisabled

Gets or sets DisableLivePrices
public bool IsLivePricesDisabled { get; set; }

Property Value

bool
True or false

IsValid

Shows if user data is valid
public bool IsValid { get; }

Property Value

bool
True or false

ItemId

Gets or sets the Id of the associated content item.
public string ItemId { get; set; }

Property Value

string

ItemType

Gets or sets the type of the associated item.
public string ItemType { get; set; }

Property Value

string

JobTitle

Gets or sets user's job title.
[AddInName("JobTitle")]
[AddInIsEditable(true)]
public string JobTitle { get; set; }

Property Value

string
User's job title.

LastName

Gets or sets user's last name.
[AddInName("LastName")]
[AddInIsEditable(true)]
public string LastName { get; set; }

Property Value

string
User's last name.

MiddleName

Gets or sets user's middle name.
[AddInName("MiddleName")]
[AddInIsEditable(true)]
public string MiddleName { get; set; }

Property Value

string
User's middle name.

Modules

Gets or sets module permissions for current user.
public ModulePermissionCollection Modules { get; set; }

Property Value

ModulePermissionCollection
Module permissions for current user.

ModulesWithInheritance

Gets the module permissions with inheritance from this user's groups
public ModulePermissionCollection ModulesWithInheritance { get; }

Property Value

ModulePermissionCollection
ModulePermissionCollection

Name

Gets or sets user's name.
[AddInName("Name")]
[AddInIsEditable(true)]
public string Name { get; set; }

Property Value

string
User's name.

Password

Gets or sets user's password.
public string Password { get; set; }

Property Value

string
User's password.

PasswordDate

Stores and retrieves password date value.
public DateTime PasswordDate { get; set; }

Property Value

DateTime
Data

PasswordRecoveryToken

Gets or sets the password recovery token.
public string PasswordRecoveryToken { get; set; }

Property Value

string
The password recovery token.

PasswordRecoveryTokenExpirationTime

Gets or sets the password recovery token expiration time.
public DateTime PasswordRecoveryTokenExpirationTime { get; set; }

Property Value

DateTime
The password recovery token expiration time.

Phone

Gets or sets user's phone number.
[AddInName("Phone")]
[AddInIsEditable(true)]
public string Phone { get; set; }

Property Value

string
User's phone number.

PhoneBusiness

Gets or sets user's business phone number.
[AddInName("PhoneBusiness")]
[AddInIsEditable(true)]
public string PhoneBusiness { get; set; }

Property Value

string
User's business phone number.

PhoneMobile

Gets or sets user's mobile phone number.
[AddInName("PhoneMobile")]
[AddInIsEditable(true)]
public string PhoneMobile { get; set; }

Property Value

string
User's mobile phone number.

PhonePrivate

Gets or sets user's private phone number.
[AddInName("PhonePrivate")]
[AddInIsEditable(true)]
public string PhonePrivate { get; set; }

Property Value

string
User's private phone number.

PointBalance

Gets user's loyalty points balance
[AddInName("PointBalance")]
public double PointBalance { get; }

Property Value

double
User's loyalty points balance.

ProfileCreated

Shows if profile was created
[AddInName("ProfileCreated")]
public bool ProfileCreated { get; }

Property Value

bool
True or false

ProfileCreatedDate

Gets or sets the profile created date
[AddInName("ProfileCreatedDate")]
public DateTime? ProfileCreatedDate { get; set; }

Property Value

DateTime?
The profile created date

Region

Gets user's region info
public RegionInfo Region { get; }

Property Value

RegionInfo

ReverseChargeForVat

Gets or sets the value indicating whether the prices for this User has reverse charge for VAT.
public bool ReverseChargeForVat { get; set; }

Property Value

bool

ShopID

Gets or sets shop identifier
[AddInName("ShopID")]
[AddInIsEditable(true)]
public string ShopID { get; set; }

Property Value

string
String value

State

Gets or sets user's state.
[AddInName("State")]
[AddInIsEditable(true)]
public string State { get; set; }

Property Value

string
User's state.

StockLocationID

Gets or sets user's stock location id.
[AddInName("StockLocationID")]
[AddInIsEditable(true)]
public long StockLocationID { get; set; }

Property Value

long

Title

Gets or sets user's title.
[AddInName("Title")]
[AddInIsEditable(true)]
public string Title { get; set; }

Property Value

string
User's title.

Type

Gets or sets user's type.
[Obsolete("Use UserType instead")]
public UserType Type { get; set; }

Property Value

UserType
User's type.

TypeID

Gets or sets user's type ID.
[Obsolete("Use UserType instead")]
public int TypeID { get; }

Property Value

int
User's type ID.

UserAndGroupType

public UserAndGroupType UserAndGroupType { get; }

Property Value

UserAndGroupType

UserAndGroupTypeSystemName

Gets or sets the SystemName.
public string UserAndGroupTypeSystemName { get; set; }

Property Value

string

UserName

Gets or sets user's user-name.
[AddInName("UserName")]
public string UserName { get; set; }

Property Value

string
User's user-name.

UserSortCollection

Gets or sets UserSort collection
public UserSortCollection UserSortCollection { get; set; }

Property Value

UserSortCollection
UserSortCollection

UserType

Gets or sets user's type.
public UserType UserType { get; set; }

Property Value

UserType
User's type.

ValidFrom

Gets or sets user's validity starting date.
[AddInName("ValidFrom")]
public DateTime ValidFrom { get; set; }

Property Value

DateTime
User's validity starting date.

ValidTo

Gets or sets user's validity ending date.
[AddInName("ValidTo")]
public DateTime ValidTo { get; set; }

Property Value

DateTime
User's validity ending date.

VatRegNumber

A value added tax identification number.
[AddInName("VatRegNumber")]
[AddInIsEditable(true)]
public string VatRegNumber { get; set; }

Property Value

string

Zip

Gets or sets user's zip code.
[AddInName("Zip")]
[AddInIsEditable(true)]
public string Zip { get; set; }

Property Value

string
User's zip code.

Methods

AddExternalLogin(int, string, string)

Adds external login to the user
[Obsolete("Use AddExternalLogOn instead")]
public void AddExternalLogin(int providerID, string providerKey, string providerUserName)

Parameters

providerID int
External login provider id
providerKey string
External login provider key
providerUserName string

AddExternalLogOn(int, string, string)

Adds external login to the user
public void AddExternalLogOn(int providerID, string providerKey, string providerUserName)

Parameters

providerID int
External login provider id
providerKey string
External login provider key
providerUserName string

AddToGroup(int)

Adds current user to the new group.
public void AddToGroup(int groupID)

Parameters

groupID int
The ID of the group to add user to.

AddToGroupAdministrators(int)

Adds current user to the group as administrator.
public void AddToGroupAdministrators(int groupID)

Parameters

groupID int
The ID of the group to add user as administrator.

Authenticate(string, string)

Authenticates user
public static LimitedUser Authenticate(string username, string password)

Parameters

username string
User name
password string
Password

Returns

LimitedUser

Authenticate(string, string, PermissionLevels)

Authenticates user
[Obsolete("Use overload without PermissionLevels and check user.AllowBackendWithInheritance, if needed.")]
public static LimitedUser Authenticate(string userName, string password, PermissionLevels permissionLevel)

Parameters

userName string
User name
password string
Password
permissionLevel PermissionLevels
Permission level

Returns

LimitedUser

Authenticate(string, string, PermissionLevels, string, bool)

Authenticates user
[Obsolete("Use overload without PermissionLevels and check user.AllowBackendWithInheritance, if needed.")]
public static LimitedUser Authenticate(string userName, string password, PermissionLevels permissionLevel, string shopID, bool updatePassword)

Parameters

userName string
User name
password string
Password
permissionLevel PermissionLevels
Permissions level
shopID string
Shop identifier
updatePassword bool
Is it needs to update password

Returns

LimitedUser
User

Authenticate(string, string, string)

Authenticates user
public static LimitedUser Authenticate(string username, string password, string shopId)

Parameters

username string
User name
password string
Password
shopId string
Shop identifier

Returns

LimitedUser

ChangePassword(string, bool)

Changes the user password.
public void ChangePassword(string newPassword, bool encryptPassword)

Parameters

newPassword string
The new password.
encryptPassword bool
Determines whether new password should be encrypted.

Delete(int)

Deletes the object with specified ID.
public override void Delete(int id)

Parameters

id int
Specified ID.

EncryptPassword()

Encrypts password
public void EncryptPassword()

Fill(IDataReader)

Fills object properties according to provided IDataReader.
public override void Fill(IDataReader reader)

Parameters

reader IDataReader
Data holder.

FillRow(DataRow)

Override the FillRow method to map all the properties values to their respective field on the datarow. Used when the object is being saved.
protected override void FillRow(DataRow row)

Parameters

row DataRow
The datarow to fill with data.

GetAncestors(string[])

Defines how ancestors can be resolved from a specified path.
public List<IPermissionControlled> GetAncestors(string[] path)

Parameters

path string[]
Path if identifiers

Returns

List<IPermissionControlled>
ancestors

GetByKey(string)

Can be used to look up a concrete object based upon the key.
public IPermissionControlled GetByKey(string key)

Parameters

key string
Identifier

Returns

IPermissionControlled
permissionControlled

GetParent()

Gets the parent of this object, for the purposes of inherited permissions.
public IPermissionControlled GetParent()

Returns

IPermissionControlled
parent

Remarks

Return null, if no parent permissions exist

GetPermissionIdentifier()

Combination of values that form a unique identifier.
public UnifiedPermissionIdentifier GetPermissionIdentifier()

Returns

UnifiedPermissionIdentifier
Unique identifier.

GetRegions()

Returns countries in the ISO format
public static List<RegionInfo> GetRegions()

Returns

List<RegionInfo>

GetUser(CommandBuilder)

Retrieves a user according to provided SQL statement in the specified command builder.
[Obsolete]
public static LimitedUser GetUser(CommandBuilder commandBuilder)

Parameters

commandBuilder CommandBuilder
The command builder.

Returns

LimitedUser

GetUserTypes(bool, bool)

Gets the user types.
public static IEnumerable<int> GetUserTypes(bool includeAngelType, bool hideAdmin = false)

Parameters

includeAngelType bool
if set to true [include angel type].
hideAdmin bool

Returns

IEnumerable<int>

GetUserTypesAsString(bool)

Retrieves all user types as comma-separated values string.
public static string GetUserTypesAsString(bool includeAngelType)

Parameters

includeAngelType bool

Returns

string
User types.

HasAccess(Group)

Determines whether current user has an access to the specified group.
[Obsolete("Use group.HasPermission(PermissionLevel) instead")]
public bool HasAccess(Group group)

Parameters

group Group
The ID of the group to check.

Returns

bool

HasGroup(int)

Determines whether current user is attached to specified group.
public bool HasGroup(int groupID)

Parameters

groupID int
The ID of the group to check.

Returns

bool

IsAdministratorUserType(UserType)

Determines whether the given user type represents an administrator.
public static bool IsAdministratorUserType(UserType userType)

Parameters

userType UserType
The user type.

Returns

bool
true if the given user type represents an administrator; otherwise, false.

IsAdministratorUserType(int)

Determines whether the given user type represents an administrator.
public static bool IsAdministratorUserType(int userType)

Parameters

userType int
The user type.

Returns

bool
true if the given user type represents an administrator; otherwise, false.

IsAngelOrAdministrator(int)

Determines whether the given user type represents an angel user or an administrator user.
public static bool IsAngelOrAdministrator(int userType)

Parameters

userType int
The user type.

Returns

bool
true if the given user type represents an angel or admin user; otherwise, false.

IsAngelUserType(int)

Determines whether the given user type represents an angel user.
public static bool IsAngelUserType(int userType)

Parameters

userType int
The user type.

Returns

bool
true if the given user type represents an angel user; otherwise, false.

IsUserNameValid()

Checks if the user name is valid.
public bool IsUserNameValid()

Returns

bool
True if the username is non-empty and not taken by another user, false otherwise

RemoveExternalLogin(int, string)

Removes external login from the user
[Obsolete("Use RemoveExternalLogOn instead")]
public void RemoveExternalLogin(int providerID, string providerKey)

Parameters

providerID int
External login provider id
providerKey string
External login provider key

RemoveExternalLogOn(int, string)

Removes external login from the user
public void RemoveExternalLogOn(int providerID, string providerKey)

Parameters

providerID int
External login provider id
providerKey string
External login provider key

RemoveFromGroup(int)

Removes current user from the group.
public void RemoveFromGroup(int groupID)

Parameters

groupID int
The ID of the group to remove user from.

RemoveFromGroupAdministrators(int)

Removes current user from the group as administrator.
public void RemoveFromGroupAdministrators(int groupID)

Parameters

groupID int
The ID of the group to remove user as administrator.

Save()

Saves current data to the data base.
public override void Save()
To top