MbSubjectsSearchResult SubjectsSearch(MbId tMbSec, MbSubjectsSearch tArg)
tMbSec. Repository connection moniker.
tArg. Operation execution parameters.
The SubjectsSearch operation searches security subjects.
The operation searches and gets information about users or groups of users that can be created in the repository security manager, on DBMS server or in the Active Directory service. To execute the operation, in the tMbSec field specify repository connection moniker, and in the tArg field specify operation execution parameters. The moniker can be obtained on executing the OpenMetabase operation.
The operation results in the collection containing information about found security subjects in case of successful search.
Below is the example of user search. The request contains repository connection moniker and search options: search only among DBMS users, user names match the specified template. The search returns information about found users.
{
"SubjectsSearch" :
{
"tMbSec" :
{
"id" : "NONMOGANMODGGOAEONFOCCMKHOOBGIMEGLBIKCNNPIACNCLJ!M"
},
"tArg" :
{
"nameCriteria" : "test*",
"isUser" : "true",
"isGroup" : "false",
"includeDb" : "true",
"includeNt" : "false",
"includeMetabaseNt" : "false"
}
}
}
{
"SubjectsSearchResult" :
{
"subjects" :
{
"Item" :
{
"k" : "158195",
"sid" :
{
"sid" : "PS-1-158195",
"type" : "User"
},
"name" : "TESTUSER",
"descr" : "TESTUSER",
"distinguishedName" : "",
"userPrincipalName" : "",
"fullName" : "",
"isNt" : "0"
}
}
}
}
public static MbSubjectsSearchResult SearchUsers(string mb)
{
var somClient = new SomPortTypeClient(); // Proxy object for operation execution
// Operation execution parameters
var tSearch = new SubjectsSearch()
{
tArg = new MbSubjectsSearch()
{
includeDb = true,
includeMetabaseNt = false,
includeNt = false,
isGroup = false,
isUser = true,
nameCriteria = "test*"
},
tMbSec = new MbId() { id = mb }
};
// User search
var result = somClient.SubjectsSearch(tSearch);
return result;
}
See also: