以文本方式查看主题

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

--  作者:bl018
--  发布时间:2011/5/1 20:26:00
--  分组权限设置
如何根据分组设置权限,(注:不是用狐表中用户管理设置的分组,)
--  作者:bl018
--  发布时间:2011/5/1 20:33:00
--  
 下载信息  [文件大小:   下载次数: ]
图片点击可在新窗口打开查看点击浏览该文件:分组授权.rar


--  作者:bl018
--  发布时间:2011/5/1 20:45:00
--  

For Each t As Table In Tables
    t.Visible =
True
    t.AllowEdit =
true

    For
Each c As Col In t.Cols
        c.Visible =
True
        c.AllowEdit =
True
    Next

Next
Tables
("授权表").Visible = (User.Type <> UserTypeEnum.User )
If
User.Type = UserTypeEnum.User Then
   
For Each dr As DataRow In DataTables("授权表").Select("分组名 = \'" & User.Group & "\'" )
        If
dr.IsNull("列名")
Then
           
Tables(dr("表名")).Visible = Not dr("不可见")
            Tables
(dr("表名")).AllowEdit = Not dr("不可编辑")

        Else
           
Tables(dr("表名")).Cols(dr("列名")).Visible = Not dr("不可见")
            Tables
(dr("表名")).Cols(dr("列名")).AllowEdit = Not dr("不可编辑")
        End
If
    Next
End
If

 

 

 

图片点击可在新窗口打开查看  谁将这段改成我要的  。。初学者不会弄


--  作者:狐狸爸爸
--  发布时间:2011/5/1 21:08:00
--  

For Each t As Table In Tables
    t.Visible = True
    t.AllowEdit = True
    For Each c As Col In t.Cols
        c.Visible = True
        c.AllowEdit = True
    Next
Next
Tables("授权表").Visible = (_UserGroup = "主管")

For Each dr As DataRow In DataTables("授权表").Select("分组名 = \'" & _UserGroup & "\'" )
    If dr.IsNull("列名") Then
        Tables(dr("表名")).Visible = Not dr("不可见")
        Tables(dr("表名")).AllowEdit = Not dr("不可编辑")
    Else
        Tables(dr("表名")).Cols(dr("列名")).Visible = Not dr("不可见")
        Tables(dr("表名")).Cols(dr("列名")).AllowEdit = Not dr("不可编辑")
    End If
Next


--  作者:bl018
--  发布时间:2011/5/1 21:32:00
--  
没效果。我原来也这样改了一下。现复制到

LoadUserSetting

也没用

 


--  作者:狐狸爸爸
--  发布时间:2011/5/1 21:40:00
--  

呵呵,仔细看看这一章内容,特别是总结部分,你会找到答案的:

http://help.foxtable.com/topics/2048.htm

 


--  作者:bl018
--  发布时间:2011/5/1 22:06:00
--  
图片点击可在新窗口打开查看然来是放错地方。。。。。。。。杯具。看来是没学到家
--  作者:bl018
--  发布时间:2011/5/1 22:15:00
--  
修正后可用了 
 下载信息  [文件大小:   下载次数: ]
图片点击可在新窗口打开查看点击浏览该文件:分组授权更正.rar

[此贴子已经被作者于2011-5-1 22:16:27编辑过]