示例#1
0
        /// <summary>
        /// 增加这一步做进一步的权限验证
        /// </summary>
        protected bool PreBeforeInvoke(string methodName)
        {
            switch (methodName)
            {
            case "GetHeader":
                p.Set(ObjName, TableName);
                break;

            case "Add":
            case "Delete":
            case "Update":
            case "Export":
            case "Import":
            case "GetList":
            case "Get":
                if (!p.Exists(ObjName))
                {
                    if (WebHelper.IsKeyInHtml(ObjName))
                    {
                        p.Set(ObjName, null);
                        return(true);
                    }
                    return(false);
                }
                break;
            }
            return(true);
        }
示例#2
0
        /// <summary>
        /// 增加这一步做进一步的权限验证
        /// </summary>
        protected bool PreBeforeInvoke(string methodName)
        {
            switch (methodName)
            {
            case "GetHeader":
                p.Set(ObjName, TableName);
                break;

            case "Add":
            case "Delete":
            case "Update":
            case "Export":
            case "Import":
            case "GetList":
            case "Get":
                if (!p.Exists(ObjName))
                {
                    string path = context.Server.MapPath(context.Request.UrlReferrer.LocalPath);
                    if (File.Exists(path))
                    {
                        //检测文件中是否有对应的关键字:
                        string html = File.ReadAllText(path);
                        if (html.Contains("\"" + ObjName + "\"") || html.Contains("'" + ObjName + "'"))
                        {
                            p.Set(ObjName, null);
                            return(true);
                        }
                    }
                    return(false);
                }
                break;
            }
            return(true);
        }
示例#3
0
        /// <summary>
        /// 增加这一步做进一步的权限验证
        /// </summary>
        protected bool PreBeforeInvoke(string methodName)
        {
            switch (methodName)
            {
            case "GetHeader":
                p.Set(ObjName, TableName);
                break;

            case "Add":
            case "Delete":
            case "Update":
            case "Export":
            case "Import":
            case "GetList":
            case "Get":
                if (!p.Exists(ObjName))
                {
                    bool isOK = false;
                    Uri  uri  = context.Request.UrlReferrer;
                    if (uri != null && Path.GetFileNameWithoutExtension(uri.LocalPath).ToLower() == "customview")
                    {
                        isOK = uri.Query.IndexOf("objName=" + ObjName, StringComparison.OrdinalIgnoreCase) > -1 ||
                               uri.Query.IndexOf("tableName=" + ObjName, StringComparison.OrdinalIgnoreCase) > -1;
                    }
                    if (isOK || WebHelper.IsKeyInHtml(ObjName))
                    {
                        p.Set(ObjName, null);
                        return(true);
                    }
                    return(false);
                }
                break;
            }
            return(true);
        }