private static void convertPrincipalRecord(Statement statement, JsonData jPrincipal)
{
foreach (KeyValuePair<string, JsonData> kvp in jPrincipal)
{
if (kvp.Value == null)
{
continue;
}
if (kvp.Value.IsArray)
{
foreach (JsonData tok in kvp.Value)
{
if (tok.IsString)
{
// Don't strip '-' and assume the policy being deserialized is already valid.
Principal principal = new Principal(kvp.Key, (string)tok, false);
statement.Principals.Add(principal);
}
}
}
else if(kvp.Value.IsString)
{
// Don't strip '-' and assume the policy being deserialized is already valid.
Principal principal = new Principal(kvp.Key, (string)kvp.Value, false);
statement.Principals.Add(principal);
}
}
}