LocalUserAccount Class

An account that represents a user whose credentials and description are managed by the Dundas BI application.
Inheritance Hierarchy

Namespace:  Dundas.BI.AccountServices
Assembly:  Dundas.BI.Core (in Dundas.BI.Core.dll) Version: 2.0.0.0 (24.3.0.1000)
Syntax
public class LocalUserAccount : Account

The LocalUserAccount type exposes the following members.

Constructors
  NameDescription
Public methodLocalUserAccount
Initializes a new instance of the LocalUserAccount class.
Top
Properties
  NameDescription
Public propertyAccountExpiryDate
Gets or sets the date when the account expires.
Public propertyAccountType
Gets the type of the account.
(Inherited from Account.)
Public propertyActiveTenantId
Gets the active tenant ID for the account.
(Inherited from Account.)
Public propertyAllowedIPAddresses
Gets or sets the allowed IP addresses.
(Inherited from MembershipBaseObject.)
Public propertyCanChangePassword
Gets or sets a value indicating whether the account holder is permitted to change their password.
Public propertyCreatedTime
Gets the UTC time the account or group was created.
(Inherited from MembershipBaseObject.)
Public propertyCulture
Gets or sets the culture associated with the account or group.
(Inherited from MembershipBaseObject.)
Public propertyCustomAttributes
Gets the account or group's explicitly assigned custom attributes.
(Inherited from MembershipBaseObject.)
Public propertyDeniedApplicationPrivilegeIds
Gets the IDs of standard privileges denied to the account or group.
(Inherited from MembershipBaseObject.)
Public propertyDescription
Gets or sets a description that may be associated with the account or group.
(Inherited from MembershipBaseObject.)
Public propertyDisplayName
Gets or sets the display name of the account.
(Inherited from Account.)
Public propertyEffectiveDisplayName
Gets the effective display name of the account.
(Inherited from Account.)
Public propertyEmailAddress
Gets or sets the account's email address.
(Inherited from Account.)
Public propertyExternalId
Gets the external ID of the account or group.
(Inherited from MembershipBaseObject.)
Public propertyFailedLogOnCount
Gets the number of consecutive log on failures for the account.
Public propertyGrantedApplicationPrivilegeIds
Gets the IDs of standard privileges granted to the account or group.
(Inherited from MembershipBaseObject.)
Public propertyId
Gets the unique identifier of the account or group.
(Inherited from MembershipBaseObject.)
Public propertyIsAccountExpired
Gets a value indicating whether the account has expired.
Public propertyIsApiAccount
Gets or sets a value indicating whether the account is an "API account".
(Inherited from Account.)
Public propertyIsEnabled
Gets or sets a value indicating whether the account is enabled.
(Inherited from Account.)
Public propertyIsGlobal
Gets or sets a value indicating whether the account is a global account.
(Inherited from Account.)
Public propertyIsLocked
Gets or sets a value indicating whether the account is locked.
Public propertyIsPasswordExpired
Gets a value indicating whether the account's password has expired.
Public propertyIsSeatReserved
Gets or sets a value indicating whether the account has a reserved seat.
(Inherited from Account.)
Public propertyLastLogOnIpAddress
Gets the IP address where the user last logon.
(Inherited from Account.)
Public propertyLastLogOnTime
Gets the UTC time the account last logged on.
(Inherited from Account.)
Public propertyLockedUntil
Gets the time until which the account is locked, or if the account is not locked.
Public propertyLogOnCount
Gets the number of times this account has logged on.
(Inherited from Account.)
Public propertyName
Gets or sets the name of the account or group.
(Inherited from MembershipBaseObject.)
Public propertyPassword
Sets the password for the account.
Public propertyPasswordExpiryDate
Gets or sets an explicit date when the account's password expires.
Public propertyPasswordLastSetDate
Gets the date (UTC) when the account's password was last set/changed.
Public propertyPasswordNeverExpires
Gets or sets a value indicating whether the account's password should never expire.
Public propertySeatKind
Gets or sets the kind of the seat used by the account or group.
(Inherited from MembershipBaseObject.)
Public propertySessionTimeout
Gets or sets the explicit session idle timeout for the account.
(Inherited from Account.)
Public propertySingleTenantId
Gets or sets the ID of the single tenant associated with the account/group.
(Inherited from MembershipBaseObject.)
Public propertyTenantId
Gets or sets the ID of the tenant associated with the account/group.
(Inherited from MembershipBaseObject.)
Public propertyTenantIds
Gets a collection containing the IDs of the tenant(s) associated with the account/group.
(Inherited from MembershipBaseObject.)
Public propertyTimeZone
Gets or sets the time zone associated with the account.
(Inherited from MembershipBaseObject.)
Public propertyTrackLogOnHistory
Gets or sets a value indicating whether log on history should be tracked for the account.
(Inherited from Account.)
Public propertyWarnings
Gets a list of warnings associated with the instance.
(Inherited from MembershipBaseObject.)
Top
Examples

This example demonstrates how to create the Dundas BI engine, start the Dundas BI engine, log on, create a local user account, and then shutdown the Dundas BI engine.

C#
using Dundas.BI;
using Dundas.BI.AccountServices;
using Dundas.BI.Services;
using System.Collections.ObjectModel;
   ...

// Create the engine.
EngineManager.CreateEngine(
    // Path to the application's data folder. Type: System.String
    @"C:\Program Files\Dundas Data Visualization Inc\Dundas BI\Instances\Instance1\www\BIWebsite\App_Data"
);

try
{
    // Start the Dundas BI Engine.
    EngineManager.StartEngine();

    // Create a caller context not associated with any session.
    using(Engine.Current.GetService<ICallerContextService>().CreateAndSetCurrentContext(null))
    {

        // LogOn.
        LogOnResult logOnResult = Engine.Current.GetService<ILogOnService>().LogOn(
            // The account name. Type: System.String
            "admin",
            // The password. Type: System.String
            "1234",
            // Delete other sessions for the logon to succeed. Type: System.Boolean
            true,
            // Culture to associate with the session, or null. Type: System.Globalization.CultureInfo
            null
        );

        // Set the current session ID.
        using(Engine.Current.GetService<ICallerContextService>().CurrentContext.SetCurrentSessionId(
            logOnResult.Session.Id
        );

        // Get the account service.
        IAccountService accountService =
            Engine.Current.GetService<IAccountService>();

        // Define the local user account.
        LocalUserAccount account = new LocalUserAccount("JohnSmith", "1234");

        // Define some properties
        account.EmailAddress = "JohnSmith@dundas.com";
        account.DisplayName = "John Smith";
        account.SeatKind = Dundas.BI.Licensing.LicenseSeatKind.StandardUser;
        account.IsSeatReserved = true;

        // Save the account.
        accountService.SaveAccount(account);
    }
}
finally
{
    EngineManager.ShutdownEngine();
}
See Also