IMetabaseAuditPolicy.FilterClass

Syntax

FilterClass(ClassID: Integer): Integer;

FilterClass[System.Int32]: System.Int32;

Parameters

ClassId. Number identifier of object class. Use the values of the MetabaseObjectClass enumeration to specify a class of the object.

Description

The FilterClass property determines a mask of operations for which the access auditing will be executed.

Comments

Access auditing by specified operations will be executed for all objects of the specified class. Auditing of operations that were activated for the classes, is more priority than the auditing of operations, the were deactivated for the particular object. The AddAce method and the AccessMask property are used to set the access of the operations auditing for the particular object.

To form and check mask value it is necessary to use a value of the enumeration type MetabaseObjectPredefinedRights. This enumeration contains basic and additional operations on which permissions can be given and access audit can be led. The specific operations are available for defined classes of objects. Depending on the class of object, the values of the following enumerations can be used in the mask:

Basic, additional and specific operations available for specified objects types are shown in theLogged Operations section.

To analyze a mask value it is necessary to implement a custom function that enables the comparison of separate mask bits with relevant enumerations values. The example of work with access mask is shown in the Working with Access Mask section.

Example

To execute the example, add the Metabase, ForeSystem (for Fore.NET example) system assemblies.

Sub UserProc;
Var
    MB: IMetabase;
    MS: IMetabaseSecurity;
    AuditPolicy: IMetabaseAuditPolicy;
    Mask: Integer;
    Lic: Object;
Begin
    MB := MetabaseClass.Active;
    
// Check out license to work with security manager
    Lic := MB.RequestLicense(UiLicenseFeatureType.Adm);
    MS := MB.Security;
    
// Change audit of the Shortcut object type
    AuditPolicy := MS.Policy.AuditPolicy;
    AuditPolicy.FilterClass(MetabaseObjectClass.KE_CLASS_SHORTCUT_AUDIT) := MetabaseObjectPredefinedRights.Write;
    
// Save changes
    MS.Apply;
    
// Check in license
    Lic := Null;
End Sub UserProc;

Imports Prognoz.Platform.Interop.Metabase;
Imports Prognoz.Platform.Interop.ForeSystem;

Public Shared Sub Main(Params : StartParams);
Var
    MB: IMetabase;
    MS: IMetabaseSecurity;
    AuditPolicy: IMetabaseAuditPolicy;
    Mask: Integer;
    Lic: Object;
Begin
    MB := Params.Metabase;
    
// Check out license to work with security manager
    Lic := MB.RequestLicense(UiLicenseFeatureType.lftAdm);
    MS := MB.Security;
    
// Change audit of the Shortcut object type
    AuditPolicy := MS.Policy.AuditPolicy;
    AuditPolicy.FilterClass[MetabaseObjectClass.KE_CLASS_SHORTCUT_AUDIT 
As Integer] := MetabaseObjectPredefinedRights.moprWrite As Integer;
    
// Save changes
    MS.Apply();
    
// Check in license
    Lic := Null;
End Sub;

After executing the example the audit of the Shortcut object type in the change mode is enabled.

See also:

IMetabaseAuditPolicy