IMetabaseSecurity.NewSubjectsSearch

Syntax

NewSubjectsSearch: ISecuritySubjectsSearch;

Description

The NewSubjectsSearch method creates an object of security subject search.

Example

To execute the example, add a link to the Metabase system assembly.

Sub UserProc;
Var
    MB: IMetabase;
    Sea: ISecuritySubjectsSearch;
    Subjs: ISecuritySubjects;
    Subj: ISecuritySubject;
    i: integer;
Begin
    MB := MetabaseClass.Active;
    Sea := MB.Security.NewSubjectsSearch;
    Sea.NameCriteria := 
"A*";
    Sea.SubjectCriteria(SecuritySubjectType.User) := 
True;
    Sea.SubjectCriteria(SecuritySubjectType.Group) := 
True;
    Sea.AreaIncludeDB := 
True;
    Sea.AreaIncludeNT := 
True;
    Sea.ExecuteSearch;
    Subjs := Sea.Subjects;
    
If Subjs.Count > 0 Then
        
For i := 0 To Subjs.Count - 1 Do
            Subj := Subjs.Item(i);
            Debug.WriteLine(Subj.Name + 
": " + Subj.Description);
        
End For;
    
End If;
End Sub UserProc;

After executing the example, security subjects, that are users and groups among domain subjects and DBMS subjects, are searched for. Name and description of the found subjects is displayed in the console.

See also:

IMetabaseSecurity