IsMember(Subject: ISecuritySubject): Boolean;
Subject. Security subject to be checked.
The IsMember method checks if the specified security subject is present in the current group of users.
The method returns True if the security subject that is passed as the Subject parameter, is a member of this group of users.
To execute the example, add a link to the Metabase system assembly.
Sub UserProc;
Var
MB: IMetabase;
MS: IMetabaseSecurity;
MG: IMetabaseGroups;
MGroup: IMetabaseGroup;
SSS: ISecuritySubjects;
SS: ISecuritySubject;
S: String;
Begin
MB := MetabaseClass.Active;
MS := MB.Security;
MG := MS.Groups;
MGroup := MG.Item(0);
SSS := MS.AllUsers;
SS := SSS.Item(200);
If MGroup.IsMember(SS) Then
Debug.WriteLine("User is included in the first group");
Else
Debug.WriteLine("User is not included in the first group");
End If;
End Sub UserProc;
After executing the example, the console will display the check result indicating whether user with the 200 index is a member of the first group of users.
See also: