Esempio n. 1
0
        public bool IsRoleAuthorizedForUrl(MDMSVC.DC_RoleAuthorizedForUrl RQ)
        {
            object result = null;

            ServiceConnection.MDMSvcProxy.PostData(ConfigurationManager.AppSettings["Admin_AuthURI"], RQ, typeof(MDMSVC.DC_RoleAuthorizedForUrl), typeof(bool), out result);
            return((bool)result);
        }
Esempio n. 2
0
        public bool IsRoleAuthorizedForUrl()
        {
            string strUserName = Convert.ToString(System.Web.HttpContext.Current.User.Identity.Name);

            if (string.IsNullOrWhiteSpace(strUserName))
            {
                HttpContext.Current.Response.Redirect("/Account/login", true);
            }
            string requestedUrl = HttpContext.Current.Request.Url.AbsolutePath;

            MDMSVC.DC_RoleAuthorizedForUrl RQ = new MDMSVC.DC_RoleAuthorizedForUrl();
            RQ.Url  = "~" + requestedUrl;
            RQ.User = strUserName;
            bool blnIsAuthorized = svc.IsRoleAuthorizedForUrl(RQ);

            return(blnIsAuthorized);
        }