AddSubject(Value: ISecuritySubject; UpdateType: MetabaseSecuritySubjectUpdateType);
AddSubject(Value: Prognoz.Platform.Interop.Metabase.ISecuritySubject; UpdateType: Prognoz.Platform.Interop.Metabase.MetabaseSecuritySubjectUpdateType);
Value. Security subject of Foresight Analytics Platform: user or domain group of users.
UpdateType. Type of update.
The AddSubject method adds a subject (a user or a domain users group) in a list for update.
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.
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: