IMetabaseUser.UserAccountType

Syntax

UserAccountType: MetabaseUserAccountType;

Description

The UserAccountType property determines a user type.

Comments

By default, regular users are created with the Ordinal type. Changing user type from Ordinal to Service is available only once; reverse change is unavailable. To change the type from Ordinal to Service or to create a user with the Service type, built-in authorization should be enabled in the repository.

When the Service type is set for the user:

The user with the Service type can be used to save as a technological account during authentication via external services.

Example

Executing the example requires built-in authorization to be enabled in the repository.

Add a link to the Metabase system assembly.

Sub CreateServiceUserExample;
Var
    MB: IMetabase;
    MS: IMetabaseSecurity;
    User: IMetabaseUser;
    Lic: Object;
Begin
    MB := MetabaseClass.Active;
    // Get license to be able to work with the security manager
    Lic := MB.RequestLicense(UiLicenseFeatureType.Adm);
    MS := MB.Security;
    // Create a new user
    User := MS.AddUser("SERVICE_USER");
    // Specify user type - Service
    User.UserAccountType := MetabaseUserAccountType.Service;
    // Save changes
    MS.Apply;
    // Check in license
    Lic := Null;
End Sub CreateServiceUserExample;

After executing the example a service user is created in the repository.

See also:

IMetabaseUser