public virtual IActionResult ValueCreatePopup(UserAttributeValueModel model)
        {
            if (!_permissionService.Authorize(StandardPermissionProvider.ManageSettings))
            {
                return(AccessDeniedView());
            }

            //try to get a user attribute with the specified id
            var userAttribute = _userAttributeService.GetUserAttributeById(model.UserAttributeId);

            if (userAttribute == null)
            {
                return(RedirectToAction("List"));
            }

            if (ModelState.IsValid)
            {
                var cav = model.ToEntity <UserAttributeValue>();
                _userAttributeService.InsertUserAttributeValue(cav);

                //activity log
                _userActivityService.InsertActivity("AddNewUserAttributeValue",
                                                    string.Format(_localizationService.GetResource("ActivityLog.AddNewUserAttributeValue"), cav.Id), cav);

                UpdateValueLocales(cav, model);

                ViewBag.RefreshPage = true;

                return(View(model));
            }

            //prepare model
            model = _userAttributeModelFactory.PrepareUserAttributeValueModel(model, userAttribute, null, true);

            //if we got this far, something failed, redisplay form
            return(View(model));
        }