// private List<string> lstOperationID; public ControlHelper(string account) { this.url = System.Web.HttpContext.Current.Request.Url.PathAndQuery.ToLower(); lstUserOperation = UserOperation.GetUserOperation(account); if (lstUserOperation == null) { //lstOperationID = lstUserOperation.Select(p => p.ControlID).ToList(); lstUserOperation = new List <Operation>(); } }
//private static Authorize.AuthorizeServiceSoapClient client = new Authorize.AuthorizeServiceSoapClient(); public static string ProcessAuthorization(string url) { //return "true"; OperationUrlSerivce opUlrService = new OperationUrlSerivce(); List <Operation> operations = UserOperation.GetUserOperation(UserInfo.Account); if (operations == null || operations.Count == 0) { return("<h2 style='text-align:center'>抱歉您没权限访问该页面!</h2>"); } foreach (var op in operations) { var urls = opUlrService.GenericService.GetAll(p => p.OperationID == op.ID); foreach (var u in urls) { if (url.ToLower().Contains(u.URL.ToLower())) { return("true"); } } } return("<h2 style='text-align:center'>抱歉您没权限访问该页面!</h2>"); }