Ejemplo n.º 1
0
        public ActionResult EnableOrDisable(int id)
        {
            if (!CheckPermission(ListsPermissions.ManageLists))
            {
                return(new HttpUnauthorizedResult());
            }

            var list = listService.GetById(id);

            listService.EnableOrDisable(list);

            if (list.Enabled)
            {
                listPathConstraint.AddPath(list.Url, list.Id);
            }
            else
            {
                listPathConstraint.RemovePath(list.Url);
            }

            return(new AjaxResult().NotifyMessage("UPDATE_LIST_COMPLETE"));
        }