以文本方式查看主题
- Foxtable(狐表) (http://foxtable.com/bbs/index.asp)
-- 专家坐堂 (http://foxtable.com/bbs/list.asp?boardid=2)
---- 用户权限的设定 (http://foxtable.com/bbs/dispbbs.asp?boardid=2&id=100852)
|
-- 作者:123456789赫力
-- 发布时间:2017/5/19 16:34:00
-- 用户权限的设定
1,为什么用户约定有的能实现有的实现不了
|
-- 作者:有点色
-- 发布时间:2017/5/19 16:39:00
--
请具体你的问题,什么不能实现?做个具体例子测试。
|
-- 作者:123456789赫力
-- 发布时间:2017/5/20 14:27:00
--
这是一个实例
此主题相关图片如下:img_9231.jpg

此主题相关图片如下:img_9234.jpg

|
-- 作者:123456789赫力
-- 发布时间:2017/5/20 14:29:00
-- 用户权限的设定
Tables("user").Visible = (User.Type <> UserTypeEnum.User ) If User.Type = UserTypeEnum.User Then For Each dr As DataRow In DataTables("user").Select("分组名 = \'" & User.Group & "\'" ) If dr.IsNull("列名") Then Tables(dr("表名")).Visible = Not dr("不可见") Tables(dr("表名")).AllowEdit = Not dr("不可编辑") For Each t As Table In Tables If t.Name.EndsWith("." & dr("表名")) Then t.Visible = Not dr("不可见") t.AllowEdit = Not dr("不可编辑") Exit For End If Next Else Tables(dr("表名")).Cols(dr("列名")).Visible = Not dr("不可见") Tables(dr("表名")).Cols(dr("列名")).AllowEdit = Not dr("不可编辑") For Each t As Table In Tables If t.Name.EndsWith("." & dr("表名")) AndAlso t.cols.Contains(dr("列名")) Then t.Cols(dr("列名")).Visible = Not dr("不可见") t.Cols(dr("列名")).AllowEdit = Not dr("不可编辑") End If Next End If Next End If
这是我的代码
此主题相关图片如下:img_9231.jpg

此主题相关图片如下:img_9234.jpg

|
-- 作者:有点蓝
-- 发布时间:2017/5/20 15:41:00
--
代码写在什么事件里的?
用户切换要放在LoadUserSetting事件
[此贴子已经被作者于2017/5/20 15:44:29编辑过]
|