配置

RG3.Web.Host.PaaS\Config\AppConfig\basis\app_config.json

  //角色条件过滤  _whereR 使用 {s-if:_whereRArea}  {e-if:_whereRArea}
  "whereRoles": {
    "filterarea": "_whereRArea",
    "filterbusiness": "_whereRBusiness",
    "filterdep": "_whereRDep",
    "filterfact": "_whereRFact",
    "filtermerc": "_whereRMerc",
    "filterrole": "_whereRole",
    "filtersupplier": "_whereRSupplier",
    "filteruser": "_whereRUser"
  },

开启特定角色过滤

  #region 开启特定角色过滤
            //角色条件过滤  _whereR 使用 {s-if:_whereRArea}  {e-if:_whereRArea}
            Dictionary<string, string> dictionaryRoles = new Dictionary<string, string>();
            root.GetSection("whereRoles").Bind(dictionaryRoles);
            if (token.Developer != 1 && token.RoleId?.Count > 0 && dictionaryRoles?.Count > 0)
            {
                foreach (var item in dictionaryRoles)
                {
                    if (token.RoleId.Contains(item.Key)) dictionaryPop[item.Value] = 1;
                }
            }
            #endregion 开启特定角色过滤
文档更新时间: 2022-10-26 09:21   作者:admin