public ActionResult Index() { if (!Init(User)) { return(RedirectToAction("Index", "Home")); } if (!_permission.Contains(PermissionEnum.CATEGORIES)) { return(RedirectToAction("Menu", "Home")); } List <Category> categoriesDb = _categoryRepository.GetAll(); CategoriesViewModel model = CategoriesViewModel.FromDb(categoriesDb); model.UserName = GetEmail(); return(View(model)); }