UserManager

UserManager

Provides the APIs for managing users in CompleteFTP. Instances of this class should be obtained using Config.users.

Methods

add(typeopt) → {User}

Description:
  • Adds a new user of the given type. The user's properties will be initialized with default values including an auto-generated user-name.

    Note that, before changes can be applied, each user must at a minimum have a unique user-name, a password and a home folder, so the added user should have these properties set before it can login (see User class).

Source:
Parameters:
Name Type Attributes Default Description
type String <optional>
Non-Windows

Type of the user which must be either 'Windows' or 'Non-Windows' (case-insensitive).

Returns:

A User object for the added user.

Type
User

get(userName) → {User}

Description:
  • Returns a User object for the given user-name.

Source:
Parameters:
Name Type Description
userName String

Name of the user.

Returns:
Type
User

remove(userName)

Description:
  • Deletes the given user.

Source:
Parameters:
Name Type Description
userName String

Name of the user to be deleted.

toArray() → {Array.<User>}

Description:
  • Returns an array of User objects representing all users in CompleteFTP including inbuilt ones.

Source:
Returns:
Type
Array.<User>