AllUsers: ISecuritySubjects;
The AllUsers property returns collection of all users, available in the current repository.
This collection includes all users which can be used on working in the repository:
Users created in the security manager of the repository.
Users having the attribute of the deferred loading of the description.
Domain users.
NOTE. For the users with the attribute if the deferred loading only the basic description will be available (name, security subject type and security descriptor). To obtain all custom parameters use IMetabaseSecurity.ResolveName, IMetabaseSecurity.ResolveSid methods or search via IMetabaseSecurity.NewSubjectsSearch.
To execute the example, add a link to the Metabase system assembly.
Sub UserProc;
Var
MB: IMetabase;
MS: IMetabaseSecurity;
Users: ISecuritySubjects;
User: ISecuritySubject;
Begin
MB := MetabaseClass.Active;
MS := MB.Security;
// Get list of users
Users := MS.AllUsers;
Debug.WriteLine("List of users: ");
For Each User In Users Do
Debug.WriteLine(User.Name);
End For;
End Sub UserProc;
Imports Prognoz.Platform.Interop.Metabase;
…
Public Shared Sub Main(Params: StartParams);
Var
MB: IMetabase;
MS: IMetabaseSecurity;
Users: ISecuritySubjects;
User: ISecuritySubject;
Begin
MB := Params.Metabase;
MS := MB.Security;
// Get list of users
Users := MS.AllUsers;
System.Diagnostics.Debug.WriteLine("List of users: ");
For Each User In Users Do
System.Diagnostics.Debug.WriteLine(User.Name);
End For;
End Sub;
After executing the example, the list of all users that are available in the current repository are displayed to the console.
See also: