/// <summary> /// 专线后台没权限输出 /// </summary> /// <param name="permit">权限枚举</param> /// <param name="isGoBack">是否输出返回上一页链接</param> public static void ResponseNoPermit(TravelPermission permit, bool isGoBack) { HttpContext.Current.Response.Clear(); HttpContext.Current.Response.Write("对不起,你没有”" + permit.ToString() + "“的权限! "); HttpContext.Current.Response.Write("<a target='_top' href='/login.aspx'>跳转到登陆页</a> "); if (isGoBack) { HttpContext.Current.Response.Write("<a href='javascript:void(0);' onclick='return history.go(-1);'>返回上一页</a>"); } HttpContext.Current.Response.End(); }
/// <summary> /// 判断当前用户是否有权限 /// </summary> /// <param name="permissionId">权限ID</param> /// <returns></returns> public bool CheckGrant(TravelPermission permission) { if (_userInfo != null) { return(_userInfo.PermissionList.Contains((int)permission)); } else { return(false); } }