public virtual IActionResult List(BlogPagingFilteringModel command) { if (!_blogSettings.Enabled) { return(RedirectToRoute("Homepage")); } var model = _blogModelFactory.PrepareBlogPostListModel(command); return(View("List", model)); }
public virtual IActionResult List(BlogPostSearchModel searchModel) { if (!_permissionService.Authorize(StandardPermissionProvider.ManageBlog)) { return(AccessDeniedDataTablesJson()); } //prepare model var model = _blogModelFactory.PrepareBlogPostListModel(searchModel); return(Json(model)); }
public IViewComponentResult Invoke() { if (!_blogSettings.Enabled || !_blogSettings.ShowBlogOnMainPage) { return(Content("")); } var command = new BlogPagingFilteringModel(); var model = _blogModelFactory.PrepareBlogPostListModel(command); return(View(model)); }
public virtual IActionResult List(BlogPostSearchModel searchModel) { bool isAuthorized = _authorizationService.AuthorizeAsync(User, GetCurrentUserAsync(), CustomerOperations.Read).Result.Succeeded; if (!isAuthorized) { return(AccessDeniedView()); } var customer = User.GetCustomer(_userManager, _customerService); BlogPostListModel model = null; if (customer.IsInCustomerRole(CustomerRole.Constants.CustomerManagersRole) && !customer.IsInCustomerRole(CustomerRole .Constants.CustomerAdministratorsRole)) { model = _blogModelFactory.PrepareBlogPostListModel(searchModel, customer.Id); return(Json(model)); } //prepare model model = _blogModelFactory.PrepareBlogPostListModel(searchModel); return(Json(model)); }
public virtual ActionResult List(BlogPagingFilteringModel command) { var model = _blogModelFactory.PrepareBlogPostListModel(command); return(View("List", model)); }