private void SetRestriction(TreeIter parent, bool val)
        {
            string nodeName            = (string)restsTreeStore.GetValue(parent, 2);
            UserRestrictionState state = val ? UserRestrictionState.Allowed : UserRestrictionState.Restricted;

            if (selectedUserId != null)
            {
                restsRoot.SetRestriction(selectedUserId.Value, nodeName, state);
            }
            else if (selectedAccessLevel != null)
            {
                restsRoot.SetRestriction(selectedAccessLevel.Value, nodeName, state);
            }

            restsTreeStore.SetValue(parent, 1, val);
        }