private void SetRole(ApplicationUser currentuser, PulledDocumentsViewModel model) { if (currentuser.Roles.Select(x => x.Role.Name).ToList().Contains(Role.PullAuthorisation)) { model.CanAuthorisePullList = true; } }
public ActionResult GetPulls(Int32 jobId) { var currentUser = this.userService.GetApplicationUser(); var pulls = this.packStoreService.GetPulledPacks(jobId); var model = new PulledDocumentsViewModel(); model.AddPulls(pulls); this.SetRole(currentUser, model); return(this.PartialView("_PulledDocuments", model)); }
public ActionResult RemovePull(String clientRef, Int32 jobId) { var currentUser = this.userService.GetApplicationUser(); this.packStoreService.UpdatePullStatus(clientRef, false); var pulls = this.packStoreService.GetPulledPacks(jobId); var model = new PulledDocumentsViewModel(); model.AddPulls(pulls); this.SetRole(currentUser, model); return(this.PartialView("_PulledDocuments", model)); }