Exemple #1
0
        /// <summary>
        /// 检查用户权限
        /// </summary>
        /// <param name="functionCode">功能代码</param>
        /// <returns>True:具有权限,False:不具有权限</returns>
        /// <returns></returns>
        public bool CheckedAuthorize(string functionCode)
        {
            // 如果是管理员的,默认具有所有权限
            if (this.IsMaster)
            {
                return(true);
            }

            //if (Authorize == null || Authorize.Count == 0)
            //    return false;

            FunctionBLL bll = new FunctionBLL();

            Authorize = bll.GetFuctionDepartmentExtentList2(" f.IsDeleted=0  AND  ur.UserId=" + currentAdmin.UserID + "");
            if (currentAdmin.UserType == 1)
            {
                return(true);
            }
            else
            {
                return(Authorize.Exists(t => t.FunctionCode == functionCode));
            }
        }