Esempio n. 1
0
        public ActionResult Delete(int id)
        {
            var computerAssembly = _computerAssemblyService.GetComputerAssembly(id);

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

            System.Security.Claims.ClaimsPrincipal currentUser = this.User;
            var userId = _userService.GetApplicationUserManager().GetUserId(this.User);

            if (computerAssembly.OwnerId != userId)
            {
                return(Forbid());
            }

            var result = _computerAssemblyService.DeleteComputerAssembly(id);

            return(Json(result));
        }