public static ELReportViewModel Create(IRepository<Action> actionRepository, IUserBLL userBLL, IPrincipal currentUser) { var viewModel = new ELReportViewModel { Actions = actionRepository.Queryable.OrderBy(x => x.Name).ToList(), Units = userBLL.GetUnitsByUser(currentUser).ToList(), AllowAllUnits = currentUser.IsInRole(RoleNames.Admin) //Admins are allowed to view all units at once }; return viewModel; }