YDEZ项目数据权限说明.docxVIP

  • 4
  • 0
  • 约2.37千字
  • 约 4页
  • 2020-12-08 发布于河南
  • 举报
? YDEZ新增数据权限说明 Record Number: N/A Version: V 1.0 Page PAGE 3 of NUMPAGES 4 Internal Use Only YDEZ Project Team Internal Use YDEZ社区管理平台新增数据权限说明 Author: Huang, Da Ping 文档说明 此文档用于描述如何对已开发完毕的模块新增数据权限控制。 修改说明 数据权限控制:用户-街道-社区。 每个用户登录后,用户只能看到和维护自己所负责的社区的相关信息。 登录用户如果是超级管理员,则可以看到和维护所有社区的相关信息。 用户登录之后,会获取用户所管辖的社区编号存入“Session[region]”,如果是管理员,则会存入空值。 代码修改说明 参考模块:社区服务-社区绿化 列表页: 在创建Where条件的方法 CreateWhereString()中增加如下代码: //获取登录用户所负责的社区 try { if (Session[region] != null) { Dictionarystring, string sqDic = (Dictionarystring, string)Session[region]; if (sqDic != null sqDic.Count 0) { foreach (KeyValuePairstring, string item in sqDic) { if (item.Key != 01) { strWhere += and a.sqjwhbh in( + item.Value + ); } } } } } catch (Exception ex) { throw ex; } 详细信息页: 维护和新增相关信息时,需要新增加一个字段:所属社区,并在页面加载时绑定登录用户所负责的社区的信息: //获取登录用户所负责的社区 string strWhere = 1=1; try { if (Session[region] != null) { Dictionarystring, string sqDic = (Dictionarystring, string)Session[region]; if (sqDic != null sqDic.Count 0) { foreach (KeyValuePairstring, string item in sqDic) { if (item.Key != 01) { strWhere += and sqjwhbh in( + item.Value + ); } } } } } catch (Exception ex) { throw ex; } ListYDEZ.Model.SQJBXX zrxqList = sqjbxxBll.GetModelList(strWhere); sqjwhbh.D

文档评论(0)

1亿VIP精品文档

相关文档