AddSubject(Value: ISecuritySubject; UpdateType: MetabaseSecuritySubjectUpdateType);
AddSubject(Value: Prognoz.Platform.Interop.Metabase.ISecuritySubject; UpdateType: Prognoz.Platform.Interop.Metabase.MetabaseSecuritySubjectUpdateType);
Value. The Prognoz Platform 9 security subject: 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. The domain group of users named PROGNOZ\TESTGROUP should be added to Prognoz Platform 9.
Sub UserProc;
Var
Sec: IMetabaseSecurity;
UsUp: IMetabaseUsersUpdate;
Subj: ISecuritySubject;
Begin
Sec := MetabaseClass.Active.Security;
UsUp := Sec.CreateUsersUpdate;
Subj := Sec.ResolveName("PROGNOZ\TESTGROUP") As ISecuritySubject;
UsUp.AddSubject(Subj, MetabaseSecuritySubjectUpdateType.DBGrant);
// Update
Sec.UpdateUsers(UsUp);
End Sub UserProc;
After executing this example, the user group is updated.
The domain group of users named PROGNOZ\TESTGROUP should be added to Prognoznbsp;Platformnbsp;9. 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("PROGNOZ\TESTGROUP1") As ISecuritySubject;
UsUp.AddSubject(Subj, MetabaseSecuritySubjectUpdateType.mesesuuptyDBGrant);
// Update
Sec.UpdateUsers(UsUp);
End Sub;
After executing this example, the user group is updated.
See also: