IsTemporary : Boolean;
The IsTemporary property returns whether the user has a temporary user account.
Executing the example requires the Button component with the Button1 identifier on the form. The example is a handler of the OnClick event for the Button1 component.
To execute the example, add a link to the Metabase system assembly.
Sub Button1OnClick(Sender: Object; Args: IMouseEventArgs);
Var MB:IMetabase;
User:IMetabaseUser;
Users:IMetabaseUsers;
Begin
// Get data of the current repository
MB:=MetabaseClass.Active;
// Get information about repository user
Users:=MB.Security.Users;
User:=Users.Item(0);
// Check if the user is temporary
If User.IsTemporary=True Then
User.TemporaryAge:=10;
Else
Debug.Write("User is not temporary");
End If;
End Sub Button1OnClick;
After executing the example, clicking the button checks if the user with the 0 identifier is temporary. If the user is temporary, the temporary period equal to 10 days using the IMetabaseUser.TemporaryAge property is set. If the user is not temporary, the console displays the message: User is not temporary.
See also: