예제 #1
0
파일: Utils.cs 프로젝트: windygu/bbl
 /// <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() + "“的权限!&nbsp;");
     HttpContext.Current.Response.Write("<a target='_top' href='/login.aspx'>跳转到登陆页</a>&nbsp;");
     if (isGoBack)
     {
         HttpContext.Current.Response.Write("<a href='javascript:void(0);' onclick='return history.go(-1);'>返回上一页</a>");
     }
     HttpContext.Current.Response.End();
 }
예제 #2
0
 /// <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);
     }
 }