CreateUsersUpdate: IMetabaseUsersUpdate;
CreateUsersUpdate: Prognoz.Platform.Interop.Metabase.IMetabaseUsersUpdate;
The CreateUsersUpdate method creates the collection, used for users updating.
To execute the example, add links to the Metabase, ForeSystem (for the Fore.NET example) system assemblies.
Sub UserProc;
Var
MB: IMetabase;
MS: IMetabaseSecurity;
Users: IMetabaseUsers;
User: IMetabaseUser;
UsUpdate: IMetabaseUsersUpdate;
Lic: Object;
Begin
MB := MetabaseClass.Active;
// Get license to work with security manager
Lic := MB.RequestLicense(UiLicenseFeatureType.Adm);
MS := MB.Security;
// Update information about users
Users := MS.Users;
UsUpdate := MS.CreateUsersUpdate;
For Each User In Users Do
UsUpdate.Add(User);
End For;
MS.UpdateUsers(UsUpdate);
// 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;
Users: IMetabaseUsers;
User: IMetabaseUser;
UsUpdate: IMetabaseUsersUpdate;
Lic: Object;
Begin
MB := Params.Metabase;
// Get license to work with security manager
Lic := MB.RequestLicense(UiLicenseFeatureType.lftAdm);
MS := MB.Security;
// Update information about users
Users := MS.Users;
UsUpdate := MS.CreateUsersUpdate();
For Each User In Users Do
UsUpdate.Add(User);
End For;
MS.UpdateUsers(UsUpdate);
// Save changes
MS.Apply();
// Check in license
Lic := Null;
End Sub;
After executing the example information about all users in current repository is updated.
See also: