AddTemporaryUser (UserName: String, Period: Integer):IMetabaseUser;
AddTemporaryUser (UserName: string, Period: integer):Prognoz.Platform.Interop.Metabase.IMetabaseUser;
The AddTemporaryUser method adds temporary user with specified period of use in days.
Executing the example requires a form containing the Button component with the Button1 identifier.
Add links to the Metabase system assembly.
Sub Button1OnClick(Sender: Object; Args: IMouseEventArgs);
Var
MB: IMetabase;
Security: IMetabaseSecurity;
User: IMetabaseUser;
Begin
MB := MetabaseClass.Active;
Security := MB.Security;
User := Security.AddTemporaryUser("USERNAME", 2);
End Sub Button1OnClick;
After executing the example clicking the button adds user with the USERNAME name and the period of use is set to 2 days.
The requirements and result of the Fore.NET example execution match with those in the Fore example. Use Fore.NET analogs instead of Fore components.
Imports Prognoz.Platform.Interop.Metabase;
Private Sub button1_Click(sender: System.Object; e: System.EventArgs);
Var
MB: IMetabase;
Security: IMetabaseSecurity;
Policy: IMetabasePolicy;
User: IMetabaseUser;
Begin
MB := Self.Metabase;
Security := MB.Security;
User := Security.AddTemporaryUser("USERNAME", 2)
End Sub;
See also: