IMetabaseUsersUpdate.AddSubject

Fore Syntax

AddSubject(Value: ISecuritySubject; UpdateType: MetabaseSecuritySubjectUpdateType);

Fore.NET Syntax

AddSubject(Value: Prognoz.Platform.Interop.Metabase.ISecuritySubject; UpdateType: Prognoz.Platform.Interop.Metabase.MetabaseSecuritySubjectUpdateType);

Parameters

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

UpdateType. Type of update.

Description

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

Fore Example

To execute the example, add the Metabase system assembly to the module. Foresight Analytics Platform must have a domain group of users with the name Foresight\TESTGROUP.

Sub UserProc;
Var
    Sec: IMetabaseSecurity;
    UsUp: IMetabaseUsersUpdate;
    Subj: ISecuritySubject;
Begin
    Sec := MetabaseClass.Active.Security;
    UsUp := Sec.CreateUsersUpdate;
    Subj := Sec.ResolveName("Foresight\TESTGROUP"As ISecuritySubject;
    UsUp.AddSubject(Subj, MetabaseSecuritySubjectUpdateType.DBGrant);
    // Update
    Sec.UpdateUsers(UsUp);
End Sub UserProc;

After executing this example, the user group is updated.

Fore.NET Example

Foresight Analytics Platform must have a domain group of users with the name Foresight\TESTGROUP. The specified procedure is an entry point for the .NET assembly.

Public Shared Sub Main(Params: StartParams);
Var
    Sec: IMetabaseSecurity;
    UsUp: IMetabaseUsersUpdate;
    Subj: ISecuritySubject;
Begin
    Sec := Params.Metabase.Security;
    UsUp := Sec.CreateUsersUpdate();
    Subj := Sec.ResolveName("Foresight\TESTGROUP"As ISecuritySubject;
    UsUp.AddSubject(Subj, MetabaseSecuritySubjectUpdateType.mesesuuptyDBGrant);
    // Update
    Sec.UpdateUsers(UsUp);
End Sub;

After executing this example, the user group is updated.

See also:

IMetabaseUsersUpdate