Esempio n. 1
0
        } //End public static Boolean isValidDBLogin

        public static void isValidCredential(ActionExecutedContext context)
        {
            //Validate Is User logged in
            if ((hlpConfig.SessionInfo.getAppUsrID() == "") ||
                (hlpConfig.SessionInfo.getAppUsrID() == null))
            {
                context.Result = new RedirectToRouteResult(new RouteValueDictionary
                {
                    { "controller", "Account" },
                    { "action", "Login" }
                });

                //HttpContext.Current.Response.Redirect("~/Account/Login");
            } //End if ((hlpConfig.SessionInfo.getAppUsrID() == "") ||

            //Validate user access control
            string sAC_MENU_RUID = context.Controller.ViewBag.AC_MENU_RUID;

            if (sAC_MENU_RUID != null)
            {
                if (sAC_MENU_RUID != APPBASE.Svcbiz.valFLAG.FLAG_ROLE_SYSADMIN)
                {
                    UserDS  oDS     = new UserDS();
                    Boolean isValid = oDS.isGranted_menu(sAC_MENU_RUID);
                    if (!isValid)
                    {
                        context.Result = new RedirectToRouteResult(new RouteValueDictionary
                        {
                            { "controller", "Error" },
                            { "action", "Error403" }
                        });
                    } //End if (!isValid)
                }     //End if (sAC_MENU_RUID != APPBASE.Svcbiz.valFLAG.FLAG_ROLE_SYSADMIN)
            }         //End if (sAC_MENU_RUID != null)
        }             //End public static string isValidCredential
Esempio n. 2
0
        } //End public static string isValidCredential

        public static Boolean isGranted_menu(string psAC_MENU_RUID)
        {
            UserDS oDS = new UserDS();

            return(oDS.isGranted_menu(psAC_MENU_RUID));
        } //End public static Boolean isValidMenu(string psAC_MENU_RUID)