以文本方式查看主题

-  Foxtable(狐表)  (http://foxtable.net/bbs/index.asp)
--  专家坐堂  (http://foxtable.net/bbs/list.asp?boardid=2)
----  权限设置  (http://foxtable.net/bbs/dispbbs.asp?boardid=2&id=190513)

--  作者:nuoyan89
--  发布时间:2024/2/19 9:45:00
--  权限设置
老师,我想让非以下人员对此表只有查看权限,无任何编辑权限,但是目前按照以下设置的除非以下所设置的其他人员反而可以编辑整个表,请帮忙看看,谢谢

Dim lst As new List(of String)
If "," & _UserGroup & "," Like "*,管理员,*" Then lst.AddRange({"材料编码", "材料描述", "库位", "总库存数", "单位", "备注", "规格型号", "可用结存", "最小起订量", "采购周期", "工装代码", "存放位置", "文件管理", "上传人员", "上传日期", "图纸", "线别", "目前状态"})
If "," & _UserGroup & "," Like "*,生产部文员,*" Then lst.AddRange({"材料编码", "材料描述", "库位", "总库存数", "单位", "备注", "规格型号", "可用结存", "最小起订量", "采购周期", "工装代码", "存放位置", "文件管理", "上传人员", "上传日期", "图纸", "线别", "目前状态"})
e.cancel = Not lst.contains(e.Col.Name)

--  作者:有点蓝
--  发布时间:2024/2/19 9:57:00
--  
意思是管理员和生产部文员可以编辑集合里的列,其它人员任何列都不能编辑?
--  作者:nuoyan89
--  发布时间:2024/2/19 11:13:00
--  
是的,就是想要二楼的那个结果,只是一楼的那个设置只能对管理员和生产部文员,其他人员却是都能编辑
[此贴子已经被作者于2024/2/19 11:14:43编辑过]

--  作者:有点蓝
--  发布时间:2024/2/19 11:15:00
--  
全局代码:
public lst As new List(of String)

登录窗口确定按钮,判断登录成功后加上以下代码
If "," & _UserGroup & "," Like "*,管理员,*" Then lst.AddRange({"材料编码", "材料描述", "库位", "总库存数", "单位", "备注", "规格型号", "可用结存", "最小起订量", "采购周期", "工装代码", "存放位置", "文件管理", "上传人员", "上传日期", "图纸", "线别", "目前状态"})
If "," & _UserGroup & "," Like "*,生产部文员,*" Then lst.AddRange({"材料编码", "材料描述", "库位", "总库存数", "单位", "备注", "规格型号", "可用结存", "最小起订量", "采购周期", "工装代码", "存放位置", "文件管理", "上传人员", "上传日期", "图纸", "线别", "目前状态"})

prepareedit事件
If "," & _UserGroup & "," Like "*,管理员,*" orelse "," & _UserGroup & "," Like "*,生产部文员,*" then
e.cancel = Not lst.contains(e.Col.Name)
else
e.cancel = true
end if