ISecuritySubject.MemberOfO

Fore Syntax

MemberOfO(Options: Integer): IMetabaseGroups;

Fore.NET Syntax

MemberOfO(Options: Integer): Prognoz.Platform.Interop.Metabase.IMetabaseGroups;

Parameters

Options. Parameters of getting a list of groups.

Description

The MemberOfO method returns a collection of groups in which the given security subject is included taking into account defined parameters of getting groups.

Comments

Determine one of the SecuritySubjectMemberOfO enumeration values as the Options parameter value.

Fore Example

Executing the example requires that the DOMAIN\TESTUSER domain user is added to the repository security manager.

Sub UserProc;
Var
    MB: IMetabase;
    User: ISecuritySubject;
    Groups: IMetabaseGroups;
    Group: IMetabaseGroup;
Begin
    MB := MetabaseClass.Active;
    User := MB.Security.ResolveName("DOMAIN\TESTUSER");
    Groups := User.MemberOfO(SecuritySubjectMemberOfO.NoNTFetch);
    For Each Group In Groups Do
        Debug.WriteLine(Group.Name + " (" + (Group.IsNT ? "Domain group of users)" : "Group of users created in the security manager)"));
    End For;
End Sub UserProc;

On executing the example a list of groups in which the specified repository user is included will be obtained. Names and types of groups will be displayed to the development environment console. The list of groups is obtained without calling the directory service.

Fore.NET Example

The requirements and result of the Fore.NET example execution match with those in the Fore example.

Imports Prognoz.Platform.Interop.Metabase;

Public Shared Sub Main(Params: StartParams);
Var
    MB: IMetabase;
    User: ISecuritySubject;
    Groups: IMetabaseGroups;
    Group: IMetabaseGroup;
Begin
    MB := Params.Metabase;
    User := MB.Security.ResolveName("DOMAIN\TESTUSER");
    Groups := User.MemberOfO(SecuritySubjectMemberOfO.ssmooNoNTFetch As Integer);
    For Each Group In Groups Do
        System.Diagnostics.Debug.WriteLine(Group.Name + " (" + (Group.IsNT ? "Domain group of users)" : "Group of users created in the security manager)"));
    End For;
End Sub;

See also:

ISecuritySubject