Getting Information about Groups of Users

Below is the example of using the GetMbSec operation to get information about groups of users created in the repository security manager. The request contains the repository connection moniker. The response contains information about groups of users.

SOAP request:

<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
<s:Body xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<GetMbSec xmlns="http://www.prognoz.ru/PP.SOM.Som">
<tMbSec xmlns=" ">
  <id>S1!M</id>
  </tMbSec>
<tArg xmlns=" ">
<pattern>
  <groups>Get</groups>
<group>
  <data>true</data>
  <members>Get</members>
  </group>
  </pattern>
  </tArg>
  </GetMbSec>
  </s:Body>
  </s:Envelope>

SOAP response:

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
<soapenv:Body>
<GetMbSecResult xmlns="http://www.prognoz.ru/PP.SOM.Som" xmlns:q1="http://www.prognoz.ru/PP.SOM.Som" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<id xmlns=" ">
  <id>S1!M</id>
  </id>
<meta xmlns=" ">
<groups>
<its>
<it>
  <k>2147483649</k>
  <id>ADMINISTRATORS</id>
  <n>ADMINISTRATORS</n>
  <vis>1</vis>
  <type>Group</type>
<sid>
  <sid>PS-2-1</sid>
  <type>Group</type>
  </sid>
<data>
  <desc>Built-in group of administrators</desc>
  <isNT>0</isNT>
  <isExternal>1</isExternal>
  <isBuiltin>1</isBuiltin>
<group>
<members>
<its>
<it>
  <k>2147483649</k>
  <id>ADMIN</id>
  <vis>1</vis>
  <type>User</type>
<sid>
  <sid>PS-1-1</sid>
  <type>User</type>
  </sid>
  </it>
<it>
  <k>545</k>
  <id>NEWADMIN</id>
  <n>NewAdmin</n>
  <vis>1</vis>
  <type>User</type>
<sid>
  <sid>PS-1-545</sid>
  <type>User</type>
  </sid>
  </it>
  </its>
  </members>
  <hasAccessToken>0</hasAccessToken>
  </group>
  </data>
  </it>
<it>
  <k>2147483650</k>
  <id>USERS</id>
  <n>USERS</n>
  <vis>1</vis>
  <type>Group</type>
<sid>
  <sid>PS-2-2</sid>
  <type>Group</type>
  </sid>
<data>
  <desc>Built-in group of users</desc>
  <isNT>0</isNT>
  <isExternal>1</isExternal>
  <isBuiltin>1</isBuiltin>
<group>
<members>
<its>
<it>
  <k>532</k>
  <id>GUEST</id>
  <n>GUEST</n>
  <vis>1</vis>
  <type>User</type>
<sid>
  <sid>PS-1-532</sid>
  <type>User</type>
  </sid>
  </it>
  </its>
  </members>
  <hasAccessToken>0</hasAccessToken>
  </group>
  </data>
  </it>
  </its>
  </groups>
  <bisearchEnable>Disable</bisearchEnable>
  </meta>
  </GetMbSecResult>
  </soapenv:Body>
  </soapenv:Envelope>

JSON request:

{
"GetMbSec" :
{
"tMbSec" :
{
"id" : "S1!M"
},
"tArg" :
{
"pattern" :
{
"groups" : "Get",
"group" :
{
"data" : "true",
"members" : "Get"
}
}
}
}
}

JSON response:

{
"GetMbSecResult" :
{
"id" :
{
"id" : "S1!M"
},
"meta" :
{
"groups" :
{
"its" :
{
"it" :
[
{
"k" : "2147483649",
"id" : "ADMINISTRATORS",
"n" : "ADMINISTRATORS",
"vis" : "1",
"type" : "Group",
"sid" :
{
"sid" : "PS-2-1",
"type" : "Group"
},
"data" :
{
"desc" : "Built-in administrator group",
"isNT" : "0",
"isExternal" : "1",
"isBuiltin" : "1",
"group" :
{
"members" :
{
"its" :
{
"it" :
[
{
"k" : "2147483649",
"id" : "ADMIN",
"vis" : "1",
"type" : "User",
"sid" :
{
"sid" : "PS-1-1",
"type" : "User"
}
},
{
"k" : "545",
"id" : "NEWADMIN",
"n" : "NewAdmin",
"vis" : "1",
"type" : "User",
"sid" :
{
"sid" : "PS-1-545",
"type" : "User"
}
}
]
}
},
"hasAccessToken" : "0"
}
}
},
{
"k" : "2147483650",
"id" : "USERS",
"n" : "USERS",
"vis" : "1",
"type" : "Group",
"sid" :
{
"sid" : "PS-2-2",
"type" : "Group"
},
"data" :
{
"desc" : "Built-in group of users",
"isNT" : "0",
"isExternal" : "1",
"isBuiltin" : "1",
"group" :
{
"members" :
{
"its" :
{
"it" :
[
{
"k" : "532",
"id" : "GUEST",
"n" : "GUEST",
"vis" : "1",
"type" : "User",
"sid" :
{
"sid" : "PS-1-532",
"type" : "User"
}
}
]
}
},
"hasAccessToken" : "0"
}
}
}
]
}
},
"bisearchEnable" : "Disable"
}
}
}
public static GetMbSecResult GetGroupInfo(string mb)
{
var somClient = new SomPortTypeClient(); //Proxy object for operation execution
//Operation execution parameters
var getMbSec = new GetMbSec()
{
tArg = new GetMbSecArg()
{
pattern = new MbSecMdPattern()
{
groups = ListOperation.Get,
group = new MbSubjectPattern()
{
data = true,
members = ListOperation.Get
}
}
},
tMbSec = new MbId() { id = mb}
};
//Get information about groups of users
var result = somClient.GetMbSec(getMbSec);
return result;
}

See also:

GetMbSec: Operation