public UnpublishedContentNotScheduledFrontendModel GetUnpublished() { var model = new UnpublishedContentNotScheduledFrontendModel(); model.Items = new List <RecentActivityFrontendModel>(); var allRecentDtos = _dashboardService.GetUnpublished(); var accessService = new UserToNodeAccessHelper(Security.CurrentUser, Services.UserService, allRecentDtos); var filteredDtos = allRecentDtos.Where(x => accessService.HasAccessTo(x)).ToList(); model.Items = CreateFrontendModelsFrom(filteredDtos); model.Count = model.Items.Count; return(model); }
public RecentActivitiesFrontendModel GetAllRecentActivities() { var model = new RecentActivitiesFrontendModel(); model.AllItems = new List <RecentActivityFrontendModel>(); model.YourItems = new List <RecentActivityFrontendModel>(); var allRecentDtos = _dashboardService.GetEntries(); var accessService = new UserToNodeAccessHelper(Security.CurrentUser, Services.UserService, allRecentDtos); var filteredDtos = allRecentDtos.Where(x => accessService.HasAccessTo(x)).ToList(); model.AllItems = CreateFrontendModelsFrom(filteredDtos); // filter to only my own var filteredMyActivitiesDtos = filteredDtos.Where(x => x.UserId == Security.CurrentUser.Id).ToList(); model.YourItems = CreateFrontendModelsFrom(filteredMyActivitiesDtos); return(model); }