IMetabasePolicy.PredefinedPrivilege

Syntax

PredefinedPrivilege(Predefined: MetabasePolicyPredefinedPrivilege): IPrivilege;

Description

The PredefinedPrivilege property returns parameters of the specified privilege.

Example

To execute the example, add a link to the Metabase system assembly.

Sub UserProc;
Var
    MB: IMetabase;
    MS: IMetabaseSecurity;
    Policy: IMetabasePolicy;
    Priv: IPrivilege;
    User: ISecuritySubject;
    Lic: Object;
Begin
    MB := MetabaseClass.Active;
    
// Check out license to work with security manager
    Lic := MB.RequestLicense(UiLicenseFeatureType.Adm);
    MS := MB.Security;
    Policy := MS.Policy;
    
// Add a privilege holder
    Priv := Policy.PredefinedPrivilege(MetabasePolicyPredefinedPrivilege.ReadAnyObject);
    User := MS.ResolveName(
"USER"As ISecuritySubject;
    Priv.Grant(User);
    
// Save changes
    MS.Apply;
    
// Check in license
    Lic := Null;
End Sub UserProc;

After executing the example, the specified USER user becomes holder of the Read and Write Permission for All Objects privilege.

See also:

IMetabasePolicy