AddGroupUsers(Value: IMetabaseGroup; UpdateType: MetabaseSecuritySubjectUpdateType);
AddGroupUsers(Value: Prognoz.Platform.Interop.Metabase.IMetabaseGroup; UpdateType: Prognoz.Platform.Interop.Metabase.MetabaseSecuritySubjectUpdateType);
Value. Group of users;
UpdateType. Type of update.
The AddGroupUsers method contains all users of a group into a list for update.
A group of users, created in the repository or the domain group of users can be specified as the group.
To execute the example, make sure that the security manager contains a group of users named Test Group.
Add links to the Metabase, ForeSystem (for the Fore.NET example) system assemblies.
Sub UserProc;
Var
MB: IMetabase;
MS: IMetabaseSecurity;
Lic: Object;
UsUp: IMetabaseUsersUpdate;
Gr: IMetabaseGroup;
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;
Gr := MS.ResolveName("Test group") As IMetabaseGroup;
UsUp.AddGroupUsers(Gr, MetabaseSecuritySubjectUpdateType.DBGrant);
// Update group members
MS.UpdateUsers(UsUp);
// Save changes
MS.Apply;
// Check in license
Lic := Null;
End Sub UserProc;
Imports Prognoz.Platform.Interop.Metabase;
Imports Prognoz.Platform.Interop.ForeSystem;
…
Public Shared Sub Main(Params: StartParams);
Var
MB: IMetabase;
MS: IMetabaseSecurity;
Lic: Object;
UsUp: IMetabaseUsersUpdate;
Gr: IMetabaseGroup;
Begin
MB := Params.Metabase;
// Check out license to work with security manager
Lic := MB.RequestLicense(UiLicenseFeatureType.lftAdm);
MS := MB.Security;
// Create an update
UsUp := MS.CreateUsersUpdate();
Gr := MS.ResolveName("Test group") As IMetabaseGroup;
UsUp.AddGroupUsers(Gr, MetabaseSecuritySubjectUpdateType.mesesuuptyDBGrant);
// Update group members
MS.UpdateUsers(UsUp);
// Save changes
MS.Apply();
// Check in license
Lic := Null;
End Sub;
After executing the example, all users of the group named Test Group are updated.
See also: