private void UpdateAccessRightSet(
SecuredObject objectToSecure,
IdentityReference identity,
bool denied,
Dictionary<string, SecuredObjectAccessRights> setToUpdate)
{
SecuredObjectAccessRights accountRights = null;
if (!setToUpdate.TryGetValue(identity.Value, out accountRights))
{
accountRights = new SecuredObjectAccessRights();
accountRights.Identity = identity;
setToUpdate.Add(identity.Value, accountRights);
}
if (denied)
{
accountRights.DeniedObjects |= objectToSecure;
}
else
{
accountRights.AllowedObjects |= objectToSecure;
}
}