Example #1
0
        public static void UserDoesNotHavePermitions(string errorMassage)
        {
            var config = InitializerSection.GetSection();

            if (AccessDeniedException.IsInService())
            {
                throw new AccessDeniedException(errorMassage);
            }

            HttpContext.Current.Response.Redirect(config.DoesNotHavePermitionsPage + "?ErrorMessage=" + HttpUtility.UrlEncode(errorMassage));
        }
Example #2
0
        public static TResult GetPersonInfoRequired <TResult>()
        {
            var value = GetPersonInfo <TResult>(GetSID());

            if (value == null)
            {
                if (AccessDeniedException.IsInService())
                {
                    throw new AccessDeniedException("User.GetPersonInfoRequired() is null");
                }
                HttpContext.Current.Response.Redirect("/MainPage.aspx/data/NoPermit");
            }

            return(value);
        }