public ActionResult Edit(int id) { if (!HttpContext.CheckAccess( ChinookResources.AlbumActions.Edit, ChinookResources.Album, id.ToString())) { return(this.AccessDenied()); } var album = _musicRepository.GetAlbum(id); if (album == null) { return(RedirectToAction("Index")); } var vm = new AlbumEditViewModel(album, _musicRepository); return(View("Edit", vm)); }