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.
{
"GetMbSec" :
{
"tMbSec" :
{
"id" : "S1!M"
},
"tArg" :
{
"pattern" :
{
"objects" : "true",
"objectsFilter" :
{
"keys" :
{
"i" :
[
"534",
"535"
]
}
}
}
}
}
}
{
"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: