Rss & SiteMap

Foxtable(狐表) http://www.foxtable.com

新一代数据库软件,完美融合Access、Foxpro、Excel、vb.net之优势,人人都能掌握的快速软件开发工具!
共2 条记录, 每页显示 10 条, 页签: [1]
[浏览完整版]

标题:自定义用户管理与可视化授权

1楼
cxabc123 发表于:2010/8/31 8:15: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

 

 

以上代码中

1、Tables("授权表").Visible = (User.Type <> UserTypeEnum.User )是什么意思?

2、当使用自定义用户管理时,以上代码要修改哪些地方?

请老大予以指点

2楼
狐狸爸爸 发表于:2010/8/31 8:33:00
1、User.Type返回用户类型,这行代码的意思是,对于非开发者和管理员,授权表不可见,代码等效于:
 
If User.Type = UserTypeEnum.User  Then
   Tables("授权表").Visible = False
End If
 
2、如果自己设计管理系统,那么是很灵活的,自己定义变量,自己定义类型,你可以:
 
If _UserGroup = "XXX" Then
    Tables("授权表").Visible = False
End If
 
没有规定一定要怎么做,自己想怎么样,就怎么样,编程没有定式。
共2 条记录, 每页显示 10 条, 页签: [1]

Copyright © 2000 - 2018 foxtable.com Tel: 4000-810-820 粤ICP备11091905号

Powered By Dvbbs Version 8.3.0
Processed in .10938 s, 2 queries.