ISecuritySnapshot.SaveToFile

Syntax

SaveToFile(FileName: String);

Parameters

FileName. The path to the security policy file, to which the security policy will be saved (*.pppolicy).

Description

The SaveToFile method saves the security policy into the file.

Example

To execute the example, add a link to the Metabase system assembly.

Sub UserProc;
Var
    MB: IMetabase;
    MS: IMetabaseSecurity;
    Sna: ISecuritySnapshot;
    Log: ISecuritySnapshotLog;
    sFile: String;
    Lic: Object;
Begin
    MB := MetabaseClass.Active;
    
// Get license to work with security manager
    Lic := MB.RequestLicense(UiLicenseFeatureType.Adm);
    MS := MB.Security;
    Sna := MS.NewSnapshot;
    
// Save security policy to file
    sFile := "c:\" + Sna.Metabase.Name + ".pppolicy";
    Sna.SaveToFile(sFile);
    Log := Sna.Log;
    
While Not Log.Eof Do
        Debug.WriteLine(Log.Message);
        Log.Next;
    
End While;
    
// Check in license
    Lic := Null;
End Sub UserProc;

After executing the example the security policy is saved to the specified file, which name corresponds to the repository name.

See also:

ISecuritySnapshot