ISecurityCategory.FindLevelByLabel

Syntax

FindLevelByLabel(CriticalityLabel: Integer): ISecurityLevel;

FindLevelByLabel(System.UInt32): Prognoz.Platform.Interop.Metabase.ISecurityLevel;

Parameters

CriticalityLabel. A criticality label, by which the search is executed.

Description

The FindLevelByLabel method searches a level with the criticality label passed as the CriticalityLabel parameter.

Example

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

Sub UserProc;
Var
    MB: IMetabase;
    MS: IMetabaseSecurity;
    MU: IMetabasePolicy;
    MAccess: IMetabaseMandatoryAccess;
    SecCat: ISecurityCategory;
    SecLev: ISecurityLevel;
Begin
    MB := MetabaseClass.Active;
    MS := MB.Security;
    MU := MS.Policy;
    MAccess := MU.MandatoryAccess;
    SecCat := MAccess.Category(
0);
    SecLev := SecCat.FindLevelByLabel(
2);
    
If SecLev <> Null Then
        Debug.WriteLine(SecLev.Name);
    
End If;
End Sub UserProc;

Imports Prognoz.Platform.Interop.Metabase;

Public Shared Sub Main(Params: StartParams);
Var
    MB: IMetabase;
    MS: IMetabaseSecurity;
    MU: IMetabasePolicy;
    MAccess: IMetabaseMandatoryAccess;
    SecCat: ISecurityCategory;
    SecLev: ISecurityLevel;
Begin
    MB := Params.Metabase;
    MS := MB.Security;
    MU := MS.Policy;
    MAccess := MU.MandatoryAccess;
    SecCat := MAccess.Category[
0];
    SecLev := SecCat.FindLevelByLabel(
2);
    
If SecLev <> Null Then
        System.Diagnostics.Debug.WriteLine(SecLev.Name);
    
End If;
End Sub;

After executing the example a security level with the "2" criticality label is searched for. A name of the found level is displayed in a development environment console if the search succeeded.

See also:

ISecurityCategory