ISecurityCategory.RemoveLevel

Syntax

RemoveLevel(Index: Integer): Boolean;

Parameters

Index. Security level index that should be removed.

Description

The RemoveLevel method removes the security level and returns whether the removal succeeded.

Example

To execute the example, make sure that mandatory access control contains at least one category and two levels.

Add a link to the Metabase system assembly.

Sub UserProc;
Var
    MB: IMetabase;
    MS: IMetabaseSecurity;
    MU: IMetabasePolicy;
    Cat: ISecurityCategory;
    MAccess: IMetabaseMandatoryAccess;
    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;
    
// Remove the second level of the first category
    Cat := MAccess.Category(0); 
    Cat.RemoveLevel(1);
    
// Save changes
    MS.Apply;
    
// Check in license
    Lic := Null;
End Sub UserProc;

After executing the example the second level will be removed from the first security category of mandatory access control.

See also:

ISecurityCategory