MemberOf: IMetabaseGroups;
The MemberOf method returns a collection of the groups to which the given security subject is included.
Sub Main;
Var
MB: IMetabase;
MSec: IMetabaseSecurity;
Users: IMetabaseUsers;
Groups: IMetabaseGroups;
Group: IMetabaseGroup;
Begin
MB := MetabaseClass.Active;
MSec := MB.Security;
Users := MSec.Users;
Groups := Users.Item(0).MemberOf;
For Each Group In Groups Do
Debug.WriteLine(Group.Name);
End For;
End Sub Main;
After executing this example names of groups where the first user located and registered in a security manager are displayed in the development environment console.
See also: