public ActionResult Settings(ViewModels.UsersGroupsSettingsVM model) { if (!_orchardServices.Authorizer.Authorize(OrchardCore.Settings.Permissions.ManageSettings, T("You don't have permission \"Manage settings\" to define and manage User Groups!"))) { return(new HttpUnauthorizedResult()); } if (!ModelState.IsValid) { _orchardServices.Notifier.Error(T("Settings update failed: {0}", T("check your input!"))); return(View(model)); } try { _usersGroupsSettingsService.WriteSettings(model); _orchardServices.Notifier.Information(T("Settings updated.")); // I read again my model in order to its ids model = _usersGroupsSettingsService.ReadSettings(); } catch (Exception exception) { _orchardServices.Notifier.Error(T("Settings update failed: {0}", exception.Message)); } return(RedirectToActionPermanent("Settings")); }