Beispiel #1
0
        public UserPathManager GetUserDefaultPath(params String[] roles)
        {
            UserPathManager pathManager = null;

            if (roles.Contains("SuperAdmin"))
            {
                pathManager = ((UserPathManager)ControllerContext.HttpContext.Application["UserPathManager"]).GetUserPath("SuperAdmin");
            }

            else if (roles.Contains("AgencyAdmin"))
            {
                pathManager             = ((UserPathManager)ControllerContext.HttpContext.Application["UserPathManager"]).GetUserPath("AgencyAdmin");
                pathManager.RouteValues = new { id = Session["AgencyID"] };
            }

            else if (roles.Contains("ClientAdmin"))
            {
                pathManager             = ((UserPathManager)ControllerContext.HttpContext.Application["UserPathManager"]).GetUserPath("ClientAdmin");
                pathManager.RouteValues = new { id = Session["AgencyID"] };
            }

            else
            {
                pathManager = ((UserPathManager)ControllerContext.HttpContext.Application["UserPathManager"]).GetUserPath(roles);
            }

            return(pathManager);
        }
Beispiel #2
0
        protected void Application_Start()
        {
            AreaRegistration.RegisterAllAreas();

            WebApiConfig.Register(GlobalConfiguration.Configuration);
            FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters);
            RouteConfig.RegisterRoutes(RouteTable.Routes);
            BundleConfig.RegisterBundles(BundleTable.Bundles);
            AuthConfig.RegisterAuth();

            UserPathManager sapd = new UserPathManager("SuperAdmin");
            UserPathManager aapd = new UserPathManager("AgencyAdmin");
            UserPathManager capd = new UserPathManager("ClientAdmin");
            UserPathManager cmpd = new UserPathManager("ClientManager");
            UserPathManager tmpd = new UserPathManager("TalentManager");
            UserPathManager tpd  = new UserPathManager("Talent");
            UserPathManager apd  = new UserPathManager("Applicant");

            sapd.AddActionDetails("Dashboard", "Home");
            aapd.AddActionDetails("Dashboard", "Agency");
            capd.AddActionDetails("Main", "Home"); //TODO: Create client admin landing page
            cmpd.AddActionDetails("Main", "Home"); //TODO: Create client manager landing page
            tmpd.AddActionDetails("Main", "Home"); //TODO: Create talent manager landing page
            tpd.AddActionDetails("Main", "Home");  //TODO: Create talent landing page
            apd.AddActionDetails("Main", "Home");  //TODO: Create applicant landing page

            sapd.Add(aapd);
            aapd.Add(capd);
            capd.Add(cmpd);
            cmpd.Add(tmpd);
            tmpd.Add(tpd);
            tpd.Add(apd);

            Application.Add("UserPathManager", sapd);
        }
Beispiel #3
0
        public ActionResult RedirectToDefault()
        {
            String[] roles = (String[])Session["Roles"];

            UserPathManager path = GetUserDefaultPath(roles);

            if (path.RouteValues != null)
            {
                return(RedirectToAction(path.Action, path.Controller, path.RouteValues));
            }

            return(RedirectToAction(path.Action, path.Controller));
        }