TemporaryAge: Integer;
The TemporaryAge property determines a period of use of temporary user account in days.
When setting period of use, the account is marked as temporary, and the IsTemporary property is set to True.
Period of use can be set only once. After the specified period is expired, the account is locked forever. The restriction is set at the platform level. If the restriction is set for a domain user, the restriction does not affect user work in domain.
Executing the example requires that the repository security manager contains the TEST_USER user.
Add a link to the Metabase system assembly.
Sub UserProc;
Var
MB: IMetabase;
User: IMetabaseUser;
Security: IMetabaseSecurity;
Begin
// Get the current repository data
MB := MetabaseClass.Active;
Security := MB.Security;
// Get user
User := Security.ResolveName("TEST_USER") As IMetabaseUser;
// Set account validity period
User.IsLocked := False;
User.TemporaryAge := 30;
// Save changes
Security.Apply;
End Sub UserProc;
After executing the example, validity period is set for the specified user account. Validity period cannot be changed after this.
See also: