public JsonResult Save(UserGroupViewModel input)
 {
     var userGroup = _authorizationRepository.GetUsersGroupById(input.EntityId);
     userGroup.Name = input.Item.Name;
     userGroup.Description = input.Item.Description;
     _authorizationRepository.UpdateUsersGroup(userGroup);
     _repository.Commit();
     return Json(new Notification{Success = true});
 }
 public ActionResult AddUpdate(UserGroupViewModel input)
 {
     var userGroup = input.EntityId>0?_authorizationRepository.GetUsersGroupById(input.EntityId) : new UsersGroup();
     var model = new UserGroupViewModel
                     {
                         Item = userGroup,
                         _Title = WebLocalizationKeys.USER_GROUP.ToString()
                     };
     return View(model);
 }
        public ActionResult ItemList(UserGroupViewModel input)
        {
            var param = (input.EntityId > 0) ? "?ParentId=" + input.EntityId : "";
            var url = UrlContext.GetUrlForAction<UserGroupPermissionListController>(x => x.Items(null)) + param;
            var gridDefinition = _grid.GetGridDefinition(url);
            var usersGroup = _authorizationRepository.GetUsersGroupById(input.EntityId);
            var model = new SecurityListViewModel
            {
                Title = WebLocalizationKeys.PERMISSIONS_FOR.ToFormat(usersGroup.Name),
                gridDef= gridDefinition,
                addUpdateRoute = SystemSupportViewOptions.GetOption<PermissionController>(x => x.AddUpdate(null), AreaName.Permissions).route,
                deleteMultipleUrl = UrlContext.GetUrlForAction<PermissionController>(x=>x.DeleteMultiple(null),AreaName.Permissions),
                headerButtons = new[] {"new","delete"}.ToList(),
                EntityId = input.EntityId,
                ParentId = usersGroup.EntityId

            };
            return Json(model,JsonRequestBehavior.AllowGet);
        }