IMetabaseUsersUpdate.AddSubject

Syntax

AddSubject(Value: ISecuritySubject; UpdateType: MetabaseSecuritySubjectUpdateType);

Parameters

Value. Security subject of Foresight Analytics Platform: user or domain group of users.

UpdateType. Update type.

Description

The AddSubject method adds a subject (a user or a domain group of users) to update list.

Example

To execute the example, make sure that the security manager contains a domain group of users named GROUP\TESTGROUP.

Add a link to the Metabase system assembly.

Sub UserProc;
Var
    MB: IMetabase;
    MS: IMetabaseSecurity;
    Lic: Object;
    UsUp: IMetabaseUsersUpdate;
    Subj: ISecuritySubject;
Begin
    MB := MetabaseClass.Active;
    
// Check out license to work with security manager
    Lic := MB.RequestLicense(UiLicenseFeatureType.Adm);
    MS := MB.Security;
    
// Create an update
    UsUp := MS.CreateUsersUpdate;
    Subj := MS.ResolveName(
"GROUP\TESTGROUP"As ISecuritySubject;
    UsUp.AddSubject(Subj, MetabaseSecuritySubjectUpdateType.DBGrant);
    
// Update group members
    MS.UpdateUsers(UsUp);
    
// Save changes
    MS.Apply;
    
// Check in license
    Lic := Null;
End Sub UserProc;

After executing the example, the domain group of users named GROUP\TESTGROUP is updated.

See also:

IMetabaseUsersUpdate