ISecurityCategory.AddLevel

Syntax

AddLevel(CriticalityLabel: Integer; Name: String): ISecurityLevel;

AddLevel(System.UInt32, System.String): Prognoz.Platform.Interop.Metabase.ISecurityLevel;

Parameters

CriticalityLabel. Criticality label for level.

Name. Level name.

Description

The AddLevel method creates a level in a security category.

Example

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

Sub UserProc;
Var
    MB: IMetabase;
    MS: IMetabaseSecurity;
    MU: IMetabasePolicy;
    MAccess: IMetabaseMandatoryAccess;
    Cat: ISecurityCategory;
    Lvl: ISecurityLevel;
    Lic: Object;
Begin
    MB := MetabaseClass.Active;
    
// Get license to work with security manager
    Lic := MB.RequestLicense(UiLicenseFeatureType.Adm);
    MS := MB.Security;
    MU := MS.Policy;
    MAccess := MU.MandatoryAccess;
    
// Add a category with levels
    Cat := MAccess.AddCategory("Category 1");
    Cat.Hierarchical := 
False;
    Lvl := Cat.AddLevel(
0"Level 0");
    Lvl.Marking := 
True;
    Lvl := Cat.AddLevel(
1"Level 1");
    Lvl.ExportAllowed := 
False;
    Lvl := Cat.AddLevel(
2"Level 2");
    Lvl.ExportAllowed := 
False;
    Lvl.PrintAllowed := 
False;
    
// 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;
    MU: IMetabasePolicy;
    MAccess: IMetabaseMandatoryAccess;
    Cat: ISecurityCategory;
    Lvl: ISecurityLevel;
    Lic: Object;
Begin
    MB := Params.Metabase;
    
// Get license to work with security manager
    Lic := MB.RequestLicense(UiLicenseFeatureType.lftAdm);
    MS := MB.Security;
    MU := MS.Policy;
    MAccess := MU.MandatoryAccess;
    
// Add a category with levels
    Cat := MAccess.AddCategory("Category 1");
    Cat.Hierarchical := 
False;
    Lvl := Cat.AddLevel(
0"Level 0");
    Lvl.Marking := 
True;
    Lvl := Cat.AddLevel(
1"Level 1");
    Lvl.ExportAllowed := 
False;
    Lvl := Cat.AddLevel(
2"Level 2");
    Lvl.ExportAllowed := 
False;
    Lvl.PrintAllowed := 
False;
    
// Save changes
    MS.Apply();
    
// Check in license
    Lic := Null;
End Sub;

After executing the example, a new hierarchical category is created in mandatory access control settings of the security manager. In this category three criticality levels are created. For each level different access parameters of export and print and also labels during export and print are assigned.

See also:

ISecurityCategory