Getting Description of Object Security

Below is the example of using the GetMbSec operation to get description of repository objects' security. The request contains the repository connection moniker and the collection of keys of objects, for which security description is obtained. The response contains information about the security subjects, for which any access permissions for the specified repository objects are set.

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>
  <objects>true</objects>
<objectsFilter>
<keys>
  <i>534</i>
  <i>535</i>
  </keys>
  </objectsFilter>
  </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=" ">
<objects>
<ods>
<its>
<d isShortcut="0" isLink="0" hf="0">
  <i>OBJ1</i>
  <n>obj1</n>
  <k>534</k>
  <c>1537</c>
  <p>533</p>
  <h>0</h>
  <sdKey>50</sdKey>
  <hasPrv>0</hasPrv>
  <ic>0</ic>
  </d>
<d isShortcut="0" isLink="0" hf="0">
  <i>OBJ2</i>
  <n>obj2</n>
  <k>535</k>
  <c>1537</c>
  <p>533</p>
  <h>0</h>
  <sdKey>546</sdKey>
  <hasPrv>0</hasPrv>
  <ic>0</ic>
  </d>
  </its>
  </ods>
<sds>
<its>
<it>
  <k>546</k>
  <isInherited>0</isInherited>
  <isSealed>0</isSealed>
<discrete>
<aces>
<it>
<subject>
  <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>
  </subject>
  <allow>1</allow>
  </it>
<it>
<subject>
  <k>2147483649</k>
  <id>ADMIN</id>
  <vis>1</vis>
  <type>User</type>
<sid>
  <sid>PS-1-1</sid>
  <type>User</type>
  </sid>
  </subject>
  <allow>1</allow>
  </it>
<it>
<subject>
  <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>
  </subject>
  <allow>98312</allow>
  <deny>16</deny>
  <audit>98312</audit>
  </it>
  </aces>
  </discrete>
<mandatory>
<accessToken>
  <its />
  </accessToken>
  </mandatory>
  </it>
<it>
  <k>50</k>
  <isInherited>1</isInherited>
  <isSealed>0</isSealed>
<discrete>
<aces>
<it>
<subject>
  <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>
  </subject>
  <allow>1</allow>
  </it>
<it>
<subject>
  <k>2147483649</k>
  <id>ADMIN</id>
  <vis>1</vis>
  <type>User</type>
<sid>
  <sid>PS-1-1</sid>
  <type>User</type>
  </sid>
  </subject>
  <allow>1</allow>
  </it>
  </aces>
  </discrete>
<mandatory>
<accessToken>
  <its />
  </accessToken>
  </mandatory>
  </it>
  </its>
  </sds>
  </objects>
  <bisearchEnable>Disable</bisearchEnable>
  </meta>
  </GetMbSecResult>
  </soapenv:Body>
  </soapenv:Envelope>

JSON request:

{
"GetMbSec" :
{
"tMbSec" :
{
"id" : "S1!M"
},
"tArg" :
{
"pattern" :
{
"objects" : "true",
"objectsFilter" :
{
"keys" :
{
"i" :
[
"534",
"535"
]
}
}
}
}
}
}

JSON response:

{
"GetMbSecResult" :
{
"id" :
{
"id" : "S1!M"
},
"meta" :
{
"objects" :
{
"ods" :
{
"its" :
{
"d" :
[
{
"@isShortcut" : "0",
"@isLink" : "0",
"@hf" : "0",
"i" : "OBJ1",
"n" : "obj1",
"k" : "534",
"c" : "1537",
"p" : "533",
"h" : "0",
"sdKey" : "50",
"hasPrv" : "0",
"ic" : "0"
},
{
"@isShortcut" : "0",
"@isLink" : "0",
"@hf" : "0",
"i" : "OBJ2",
"n" : "obj2",
"k" : "535",
"c" : "1537",
"p" : "533",
"h" : "0",
"sdKey" : "546",
"hasPrv" : "0",
"ic" : "0"
}
]
}
},
"sds" :
{
"its" :
{
"it" :
[
{
"k" : "546",
"isInherited" : "0",
"isSealed" : "0",
"discrete" :
{
"aces" :
{
"it" :
[
{
"subject" :
{
"k" : "2147483649",
"id" : "ADMINISTRATORS",
"n" : "ADMINISTRATORS",
"vis" : "1",
"type" : "Group",
"sid" :
{
"sid" : "PS-2-1",
"type" : "Group"
}
},
"allow" : "1"
},
{
"subject" :
{
"k" : "2147483649",
"id" : "ADMIN",
"vis" : "1",
"type" : "User",
"sid" :
{
"sid" : "PS-1-1",
"type" : "User"
}
},
"allow" : "1"
},
{
"subject" :
{
"k" : "545",
"id" : "NEWADMIN",
"n" : "NewAdmin",
"vis" : "1",
"type" : "User",
"sid" :
{
"sid" : "PS-1-545",
"type" : "User"
}
},
"allow" : "98312",
"deny" : "16",
"audit" : "98312"
}
]
}
},
"mandatory" :
{
"accessToken" :
{
"its" : ""
}
}
},
{
"k" : "50",
"isInherited" : "1",
"isSealed" : "0",
"discrete" :
{
"aces" :
{
"it" :
[
{
"subject" :
{
"k" : "2147483649",
"id" : "ADMINISTRATORS",
"n" : "ADMINISTRATORS",
"vis" : "1",
"type" : "Group",
"sid" :
{
"sid" : "PS-2-1",
"type" : "Group"
}
},
"allow" : "1"
},
{
"subject" :
{
"k" : "2147483649",
"id" : "ADMIN",
"vis" : "1",
"type" : "User",
"sid" :
{
"sid" : "PS-1-1",
"type" : "User"
}
},
"allow" : "1"
}
]
}
},
"mandatory" :
{
"accessToken" :
{
"its" : ""
}
}
}
]
}
}
},
"bisearchEnable" : "Disable"
}
}
}
public static GetMbSecResult GetObjectSecurityDescriptor(string mb, int[] objKeys)
{
var somClient = new SomPortTypeClient(); //Proxy object for operation execution
//Operation execution parameters
var getMbSec = new GetMbSec()
{
tArg = new GetMbSecArg()
{
pattern = new MbSecMdPattern()
{
objects = true,
objectsFilter = new MbSecOdFilter()
{
keys = objKeys
}
}
},
tMbSec = new MbId() { id = mb }
};
//Get description of object security
var result = somClient.GetMbSec(getMbSec);
return result;
}

See also:

GetMbSec: Operation