IPrivilege.Revoke

Syntax

Revoke(Subject: ISecuritySubject);

Parameters

Subject. Security subject.

Description

The Revoke method revokes the privilege from the security subject that is sent by the Subject parameter.

Example

To execute the example, make sure that the security manager contains the USER user.

Add a link to the Metabase system assembly.

Sub UserProc;
Var
    MB: IMetabase;
    MS: IMetabaseSecurity;
    MP: IMetabasePolicy;
    Priv: IPrivilege;
    Subject: ISecuritySubject;
    Lic: Object;
Begin
    MB := MetabaseClass.Active;
    
// Check out license to work with security manager
    Lic := MB.RequestLicense(UiLicenseFeatureType.Adm);
    MS := MB.Security;
    MP := MS.Policy;
    
// Delete privilege holder
    Priv := MP.Privilege("READ");
    Subject := MS.ResolveName(
"USER");
    Priv.Revoke(Subject);
    
// Save changes
    MS.Apply;
    
// Check in license
    Lic := Null;
End Sub UserProc;

After executing the example the privilege for reading and opening repository objects is revoked from the USER user.

See also:

IPrivilege