Anchor |
---|
| ManagingUsersWithScripts |
---|
| ManagingUsersWithScripts |
---|
|
Managing Users with scripts
During the launch of an application, the Login process accepts all users defined in the Project Configuration. Additionally, it is possible to add Runtime Users during runtime execution dynamically, and they are stored in a default database located in Datasets → Dos BDs → RuntimeUsers. Customization of the database used for user storage is also possible in the Module Datasets. Furthermore, users can be created or modified using the Security Namespace's available methods.
To simplify user management, a platform Plugin is available in the Security Module module that provides a template application for creating a Runtime Display. The UserManagement Plugin can be imported by selecting the appropriate Plugin in Project → Plugins. Once imported, the Plugin creates names, such as SecurityAccounts
and ChangePass
, that aid in user management.
The Security Namespace offers a wide range of methods that can be used to create or modify Runtime Users before starting runtime execution or during project execution. The documentation provides detailed information on the available features and methods, allowing users to enhance their application's functionality and flexibility during runtime. By utilizing the Security Modulemodule's capabilities, users can effectively manage Runtime Users, increasing the overall security and functionality of their applications.
In the following, you can find more details regarding the available RuntimeUser
methods in the Security namespace:
The AddRuntimeUser
method adds a new runtime user with detailed information.
Code Block |
---|
language | c# |
---|
title | Creating RuntimeUser examples | AddRuntimeUser |
---|
|
Adding Runtime Users
@Security.NewRuntimeUser(string name, out int errorCode)
// Creates a new RuntimeUser
// name: User Name
// errorCode: Error code (output)
// Returns: String containing the error message (if error) or empty (if not error)
@Security.AddRuntimeUser(string name, string permissionsStr, string password, string passwordHint, string policyStr, string profilePhone, string profileCompleteName, bool oneTimePassword)
// Add Runtime User
// name: User Name
// permissions Str: Permissions
// password: Password
// passwordHint: Password hint
// policyStr: Policy
// profileEmail: Profile email
// profilePhone: Profile phone
// profileCompleteName: Profile complete name
// oneTimePassword: flag (true or false) to set a One Time Password setting. If true, a password change is required after first login
// Returns: String containing error message (if error) or empty (if not error) |
Where:
name
: The user's name;permissionsStr
: A string representing the permissions the user has.
password
: The user's password.
passwordHint
: A hint for the password.
policyStr
: A string representing the user's policy.
profilePhone
: The user's phone number.
profileCompleteName
: The user's full name.
oneTimePassword
: A boolean value indicating whether the user is required to change their password after the first login. If this is true, the user will have to change their password after their first login.
The NewRuntimeUser
method creates a new runtime user. You pass the user's name as a string to the name parameter. If there's an error during the creation of the user, an error code will be outputted via the errorCode parameter.
Code Block |
---|
language | c# |
---|
title | BewRuntimeUser |
---|
|
@Security.NewRuntimeUser(string name, out int errorCode) |
The function also returns a string - if there's an error, this string will contain an error message; if there isn't an error, it will be empty.