Could not help with the code or share a useful link on this issue. The task is the following, in my main table where the data lie there is a column "Branch". In this column there are 25 names for each of the names, I will create (l) 25 links where the user will have a choice. The catch is that for each link, I'm going to assign access to a specific group from ActiveDirectory. I can create another 24 of the same controllers and carry out my plans, but this will not be correct.

My controller is next

[HttpGet] public ActionResult TestNew(string branchname) { // check stuff like permissions var db = new MovieContext(); var model = new Model(); var students = db.Student .Where(x => x.BranchName == branchname) .GroupBy(x => new { x.BranchName, x.Name, x.Currency, x.NoCart, x.NoAccount }) .Select(x => new { BranchName = x.FirstOrDefault().BranchName, Name = x.FirstOrDefault().Name, A_Status = x.Max(p => p.A_Status), Currency = x.FirstOrDefault().Currency, NoCart = x.FirstOrDefault().NoCart, NoAccount = x.FirstOrDefault().NoAccount }).ToList(); foreach (var item in students) { model.Students.Add(new Student { A_Status = item.A_Status, BranchName = item.BranchName, Name = item.Name, NoAccount = item.NoAccount, NoCart = item.NoCart, Currency = item.Currency }); } return View(model); 
  • Why do not you want to pull LDAP in your method for the information you need and, depending on the answer, give either HTTP 403 or a page? In the core, ldap has not been delivered yet , but from the classic asp.net mvc should work without problems. - AK
  • That is?) How to implement it - white fang
  • By the way, he is twitching with ActiveDirectory - white fang
  • If I specify a group from AD then the access will apply to the specified controller - white fang
  • Specify the minimum group from AD (for example, Users), check other groups from the code. - AK

0