0
내 앱에서 다른 조직과 관련된 역할이 다릅니다. 나는사용자에게 그가 갈 수있는 경로 목록 표시
- Crondale 조직 유형이
주방처럼 여러 조직을 가질 수
(우리의 내부 시스템)
기관 가진 여러 주방 (기관 1 기관 2 등)
이제 역할
밥
조직 유형 주방의 admin이고 주방 1.이 같다지금까지 모든 것이 원활하게 작동합니다. 이제 문제는 사용자가 여러 역할을 할 수 있다는 것입니다. 그래서 예를 들어, 부엌 1에 대한 관리되는 또한
는, 밥은 기관에서 간호사도 1이제 나는 사용자가 로그인이 모든 역할 유형을 얻을 때, 다음 수 있도록되어 원하는 사용자는 그가 가고자하는 것을 선택할 수 있습니다. 그것이 단지 하나라면 그를 바로 데려가십시오. 그러나 배수를 위해 무엇이 완료되어야 하는가?
이것은 내가 지금까지 뭘 오전입니다
public ActionResult Dashboard()
{
User user = TableHelper.Get<User>("1", User.Identity.Name);
if (user != null)
{
List<OrganizationValues> data = CheckOrganizationType.organizationType(user); // getting organization type
if (data.Count() == 1) // if we have one role at a time
{
foreach (OrganizationValues ov in data)
{
if (ov.name != "crondale" && ov.name != "") // which means it doesn't belong to US!
{
return RedirectToAction("Dashboard", System.Globalization.CultureInfo.CurrentCulture.TextInfo.ToTitleCase(ov.name), new { id = ov.organizationId, roleId = ov.roleType });
}
else // we are crondale
{
ViewBag.rolesType = getRoles();
ViewBag.organizationTypes = getOrganizationTypes();
}
}
return View(user);
}
else // you have more than 1 role
{
}
} // if user is not logged in
else
{
return RedirectToAction("Index", "Site");
}
}
최선의 방법으로이를 수행하는 방법에 대한 통찰력?