Ejemplo n.º 1
0
        public IActionResult DeleteNew(int Id)
        {
            var deletedNew = newService.FindNewBy(Id);

            if (deletedNew == null)
            {
                return(this.RedirectToAction("Index", "Home"));
            }

            if (deletedNew.PhotographyAddictedUserId == this.User.FindFirstValue(ClaimTypes.NameIdentifier) || this.User.IsInRole("Moderator"))
            {
                return(View(deletedNew));
            }

            return(this.RedirectToAction("PreviewNews", "News"));
        }