Opc.Ua.Configuration.ManageAccessRulesDlg.UpdateAccessRightSet C# (CSharp) Method

UpdateAccessRightSet() private method

Updates the access right set with the permissions for the specified object.
private UpdateAccessRightSet ( SecuredObject objectToSecure, IdentityReference identity, bool denied, SecuredObjectAccessRights>.Dictionary setToUpdate ) : void
objectToSecure SecuredObject
identity System.Security.Principal.IdentityReference
denied bool
setToUpdate SecuredObjectAccessRights>.Dictionary
return void
        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;
            }
        }