/// <summary>
        ///开启 当前用户过滤
        /// </summary>
        public const string FILTER_OPEN_USER = "_filterOpenUser";


{s-if:_filterOpenUser}  and column=@_userId {e-if:_filterOpenUser}
\AppConfig\basis\app_config.json

 "defauleValues": {
    "_defaultUserId": "member",
    "_defaultRoleId": "member",
    "_defaultAreaCode": "350000",
    "_defaultDepId": "member",
    "_defaultJobId": "member",
    "_defaultSysId": "1b5d7033-6c15-485e-7ea517509d1b-be1b",
    //不受 _filterOpenUser 条件控制的角色
    "_defaultOpenUserRoleId": "dbadmim,development"
  },

  #region 当前用户条件过滤
            //{s-if:_filterOpenUser}  and column=@_userId {e-if:_filterOpenUser}
            bool openU = true;
            if (token.Developer == 1)
            {
                openU = false;
            }
            else if (dictionaryPop.ContainsKey("_defaultOpenUserRoleId") && token.RoleId?.Count > 0)
            {
                var vals = new List<string>(dictionaryPop["_defaultOpenUserRoleId"].ToString().Split(','));
                //没有交集,开启当前用户过滤
                openU = vals.Intersect(token.RoleId).Count() == 0;
            }
            if (openU)
            {
                dictionaryPop[SystemParamConst.FILTER_OPEN_USER] = 1;
            }
            #endregion 当前用户条件过滤
文档更新时间: 2022-10-26 09:11   作者:admin