public ActionResult Agency_Read([DataSourceRequest] DataSourceRequest request) { AgencyHomePageView agencyHomePageView = new AgencyHomePageView(); agencyHomePageView.EmployeeView = GetEmployee(); #region Access Check bool hasPermission = GetEmployee().IsGuaranteed("Agency_Read"); if (!hasPermission) { return(Json(agencyHomePageView.AgencyViews.ToDataSourceResult(request))); } #endregion agencyHomePageView.AgencyViews = this._agencyService.GetAgencies().data; return(Json(agencyHomePageView.AgencyViews.ToDataSourceResult(request))); }
public ActionResult Index() { AgencyHomePageView agencyHomePageView = new AgencyHomePageView(); agencyHomePageView.EmployeeView = GetEmployee(); #region Access Check bool hasPermision = GetEmployee().IsGuaranteed("Agency_Read"); if (!hasPermision) { ModelState.AddModelError("", "AccessDenied"); return(View(agencyHomePageView)); } #endregion agencyHomePageView.AgencyViews = this._agencyService.GetAgencies().data; return(View(agencyHomePageView)); }