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

            var typeViewModel = _contentDefinitionService.LoadType(id);

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

            _contentDefinitionService.RemoveType(id, true);

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

            return(RedirectToAction("List"));
        }