AddLevel(CriticalityLabel: Integer; Name: String): ISecurityLevel;
CriticalityLabel - a criticality label for the level.
Name is a level name.
The AddLevel method creates a level in a security category.
Sub Main;
Var
MB: IMetabase;
MS: IMetabaseSecurity;
MU: IMetabasePolicy;
MAccess: IMetabaseMandatoryAccess;
Cat: ISecurityCategory;
Lvl: ISecurityLevel;
Begin
MB := MetabaseClass.Active;
MS := MB.Security;
MU := MS.Policy;
MAccess := MU.MandatoryAccess;
Cat := MAccess.AddCategory("Category 1");
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;
MS.Apply;
End Sub Main;
After executing the example a new category is created in settings of mandatory access of 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: