AddCategory(Name: String): ISecurityCategory;
Name. New category name.
The AddCategory method creates security category.
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;
// Get mandatory access control settings
MAccess := MU.MandatoryAccess;
// Add a new category and security levels
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;
// Save changes
MS.Apply;
// Check in license
Lic := Null;
End Sub UserProc;
After executing the example a new category is created in mandatory access of a security manager. In this category three security levels are created. For each level different access parameters of export and print and also labels during export and print are assigned.
See also: