Example #1
0
        public async Task <ActionResult> DeletePart(string id)
        {
            if (!await _authorizationService.AuthorizeAsync(User, Permissions.EditContentTypes))
            {
                return(Forbid());
            }

            var partViewModel = _contentDefinitionService.LoadPart(id);

            if (partViewModel == null)
            {
                return(NotFound());
            }

            _contentDefinitionService.RemovePart(id);

            _notifier.Information(H["\"{0}\" has been removed.", partViewModel.DisplayName]);

            return(RedirectToAction("ListParts"));
        }