IsMember(Subject: ISecuritySubject): Boolean;
IsMember(Prognoz.Platform.Interop.Metabase.ISecuritySubject): System.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;
Imports Prognoz.Platform.Interop.Metabase;
…
Public Shared Sub Main(Params : StartParams);
Var
MB: IMetabase;
MS: IMetabaseSecurity;
MG: IMetabaseGroups;
MGroup: IMetabaseGroup;
SSS: ISecuritySubjects;
SS: ISecuritySubject;
S: String;
Begin
MB := Params.Metabase;
MS := MB.Security;
MG :=MS.Groups;
MGroup := MG.Item[0];
SSS := MS.AllUsers;
SS := SSS.Item[200];
If MGroup.IsMember(SS) Then
System.Diagnostics.Debug.WriteLine("User is included in the first group");
Else
System.Diagnostics.Debug.WriteLine("User is not included in the first group");
End If;
End Sub;
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: