ISecurityCategory.AddLevel

Syntax

AddLevel(CriticalityLabel: Integer; Name: String): 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 a link to the Metabase system assembly.

Sub UserProc;
Var
    MB: IMetabase;
    MS: IMetabaseSecurity;
    MU: IMetabasePolicy;
    MAccess: IMetabaseMandatoryAccess;
    Cat: ISecurityCategory;
    Lvl: ISecurityLevel;
    Lic: Object;
Begin
    MB := MetabaseClass.Active;
    
// Check out 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;

After executing the example a new hierarchical category is created in mandatory access control settings of the security manager. Three criticality levels are created in this category. Different export and print access options and also labels during export and print are assigned for each level.

See also:

ISecurityCategory