Search Results for

    Show / Hide Table of Contents

    Class SetupRootAccount

    Inheritance
    object
    SetupRootAccount
    Implements
    IDefaultMenuItemCreator
    Inherited Members
    object.GetType()
    object.MemberwiseClone()
    object.ToString()
    object.Equals(object)
    object.Equals(object, object)
    object.ReferenceEquals(object, object)
    object.GetHashCode()
    Namespace: LemonEdge.Connections.Database.Migrations.Core
    Assembly: LemonEdge.Database.Connector.dll
    Syntax
    public class SetupRootAccount : IDefaultMenuItemCreator

    Constructors

    SetupRootAccount(IDataAccessor, IEntityContextFactory, IReflectionHelper, IFactoryInjector, IDatabaseCacheFactory)

    Declaration
    public SetupRootAccount(IDataAccessor accessor, IEntityContextFactory entityContextFactory, IReflectionHelper reflectionHelper, IFactoryInjector factoryInjector, IDatabaseCacheFactory cacheFactory)
    Parameters
    Type Name Description
    IDataAccessor accessor
    IEntityContextFactory entityContextFactory
    IReflectionHelper reflectionHelper
    IFactoryInjector factoryInjector
    IDatabaseCacheFactory cacheFactory

    Fields

    ROLE_ADMIN_NAME

    Declaration
    public const string ROLE_ADMIN_NAME = "Admin"
    Field Value
    Type Description
    string

    ROLE_USER_NAME

    Declaration
    public const string ROLE_USER_NAME = "Standard User"
    Field Value
    Type Description
    string

    ROOT_ACCOUNT_ID

    Declaration
    public const int ROOT_ACCOUNT_ID = 1
    Field Value
    Type Description
    int

    ROOT_DEFAULT_PASSWORD

    Declaration
    public const string ROOT_DEFAULT_PASSWORD = "!ltroot"
    Field Value
    Type Description
    string

    ROOT_USER_NAME

    Declaration
    public const string ROOT_USER_NAME = "root@lemonedge.com"
    Field Value
    Type Description
    string

    TEAM_ADMIN_NAME

    Declaration
    public const string TEAM_ADMIN_NAME = "Admin"
    Field Value
    Type Description
    string

    TEAM_USER_NAME

    Declaration
    public const string TEAM_USER_NAME = "Standard User"
    Field Value
    Type Description
    string

    Properties

    AdminRoleID

    The globally unique id of the standard admin role

    Declaration
    public Guid AdminRoleID { get; }
    Property Value
    Type Description
    Guid

    Cache

    A local cache

    Declaration
    public IReadOnlyCache Cache { get; }
    Property Value
    Type Description
    IReadOnlyCache

    StandardRoleID

    The globally unique id of the standard user role

    Declaration
    public Guid StandardRoleID { get; }
    Property Value
    Type Description
    Guid

    Methods

    CreateMenuItem(Guid, short, string, bool, short, string, short, ICommandDescriptor, bool, bool, bool, bool, bool, bool)

    Creates the specified menu item

    Declaration
    public Task CreateMenuItem(Guid roleID, short tabIndex, string tabName, bool activeOnAllMenus, short groupIndex, string groupName, short itemIndex, ICommandDescriptor defaultDescription, bool activateOnLoad, bool addToMenuBar, bool addToUserMenuBar, bool addToQuickAccess, bool visible, bool addToSimplified)
    Parameters
    Type Name Description
    Guid roleID

    The role this menu command belongs to

    short tabIndex

    The index of the tab this command will belong to

    string tabName

    The name of the the tab this command will belong to

    bool activeOnAllMenus

    Indicates this command should appear on all menus created for this role.

    This is often used to provide consistent access to common commands such as Save from everywhere.

    short groupIndex

    The index of the group within the tab that this command will belong to

    string groupName

    The name of the group within the tab that this command will belong to

    short itemIndex

    The index of the command within the group that this command will belong to

    ICommandDescriptor defaultDescription

    A user friendly description of the function of this item command

    bool activateOnLoad

    Indicates this command should be activated when the menus are first loaded in the client as a default activation

    bool addToMenuBar

    This indicates the command should also appear in the menu bar at the top right near the user menu.

    If you also mark this command as invisible then it will only appear in the menu bar, and not on the main menu itself.

    bool addToUserMenuBar

    This indicates the command should also appear in the user menu at the top right.

    If you also mark this command as invisible then it will only appear in the user menu, and not on the main menu itself.

    bool addToQuickAccess

    This indicates the command should also appear in the quick access at the top left of the app.

    If you also mark this command as invisible then it will only appear in the quick access, and not on the main menu itself.

    bool visible

    Indicates if this command should be visible on the main menu.

    This is usually used to hide the command from the main menu and make it visible in the user menu, or quick access, only.

    bool addToSimplified

    By default the menu shows all commands. However if you start selecting commands as being part of a simplified set, then by default the menu will show the simplified set only. When you toggle the simplified menu you can then see all the other commands as well.

    Returns
    Type Description
    Task

    EnsureImageExists(string, Guid, byte[])

    Ensures the specified custom image exists in the system

    Declaration
    public Task EnsureImageExists(string imageName, Guid imageID, byte[] imageResource)
    Parameters
    Type Name Description
    string imageName

    The Name of the custom image

    Guid imageID

    The unique ImageID for this custom image

    byte[] imageResource

    The raw image

    Returns
    Type Description
    Task

    A task indicating the completion of the operation

    GetCurrentMenu(Guid)

    Returns all the current menu items for the specified role

    Declaration
    public IEnumerable<IMenuItem> GetCurrentMenu(Guid roleID)
    Parameters
    Type Name Description
    Guid roleID

    The role to return all current menu items for

    Returns
    Type Description
    IEnumerable<IMenuItem>

    All the current menu items for the specified role

    GetOrCreateAdminUser(long, string, string, IDataAccessor, IDbConnection)

    Declaration
    public static Task<(IUser, IAccountMaintenance)> GetOrCreateAdminUser(long forAccountId, string adminUserLogin, string adminPassword, IDataAccessor accessor, IDbConnection cn)
    Parameters
    Type Name Description
    long forAccountId
    string adminUserLogin
    string adminPassword
    IDataAccessor accessor
    IDbConnection cn
    Returns
    Type Description
    Task<(IUser, IAccountMaintenance)>

    RemoveMenuItem(IMenuItem)

    Remove the specified menu item (typically retrieved from GetCurrentMenu(Guid)) from the system

    Declaration
    public Task RemoveMenuItem(IMenuItem menuItem)
    Parameters
    Type Name Description
    IMenuItem menuItem

    The menu item to be removed from the system

    Returns
    Type Description
    Task

    A task indicating the completion of the operation

    RunCustomMenuInserters(IUser, string)

    Declaration
    public Task RunCustomMenuInserters(IUser user, string dbAlias = "")
    Parameters
    Type Name Description
    IUser user
    string dbAlias
    Returns
    Type Description
    Task

    SetupUserAsAdmin(long, string, string, string)

    Declaration
    public Task<IUser> SetupUserAsAdmin(long forAccountID, string adminUserLogin = "", string adminPassword = "", string dbAlias = "")
    Parameters
    Type Name Description
    long forAccountID
    string adminUserLogin
    string adminPassword
    string dbAlias
    Returns
    Type Description
    Task<IUser>

    Implements

    IDefaultMenuItemCreator

    Extension Methods

    LinqExtensions.AsArray<T>(T)
    LinqExtensions.ToArrayOfOne<T>(T)
    LinqExtensions.ToListOfOne<T>(T)
    MiscExtensions.SetIfNotEqual<T, TP>(T, Expression<Func<T, TP>>, TP)
    WeakReferenceExtensions.WeakReference(object)
    SQLExtensions.ToSQLValue(object, bool)
    ReflectionExtensions.ClearEventInvocations(object, string)
    StringExtensions.ToCSVFormatString(object, Type)
    In this article
    Back to top © LemonEdge Technologies. All rights reserved.