以文本方式查看主题

-  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=33963)

--  作者:anxue
--  发布时间:2013/5/28 8:28:00
--  [求助]目录树授权下的表

窗口授权 事件和调用函数

AfterLoad

 

If Functions.Execute("shouquan","我的桌面","事件提醒器")=False Then
   MessageBox.SHow("你没有权限!","提示")
   e.Form.Close
End If

 

如果“事件提醒器” 是个表   在表的那个事件中添加代码?代码如何写?


--  作者:Bin
--  发布时间:2013/5/28 8:38:00
--  
不太明白你的意思
--  作者:anxue
--  发布时间:2013/5/28 8:46:00
--  
目录树授权  有窗口 也有表  上面是窗口调用代码?  表授权代码 如何写?
--  作者:Bin
--  发布时间:2013/5/28 8:48:00
--  
也是一样的啊,如果你函数的代码是写好判断的了.
--  作者:anxue
--  发布时间:2013/5/28 8:55:00
--  

If User.Type <> UserTypeEnum.User Then \' 如果是开发者或者管理员
    Return True \'则具备所有权限
End If
Dim dt As DataTable = DataTables("授权")
Dim dr As DataRow
\'首先判断分组的授权用户是否包括此用户或此用户所属的分组
dr = dt.Find("分组 = \'" & args(0) & "\' And 权限 Is Null" )
If dr Is Nothing Then
    MessageBox.show("不存在名为""" & args(0) & "分组!","提示",MessageBoxButtons.OK,MessageBoxIcon.Information)
    Return False
End If
If dr.IsNull("用户") = False Then
    Dim nms() As String = dr("用户").Split(",")
    For Each nm As String In nms
        If nm = User.Group OrElse nm = User.Name Then \'如果授权用户包括登录用户所属的分组或其用户名
            Return True \'返回True
        End If
    Next
End If
\'然后判断权限的授权用户是否包括此用户或此用户所属的分组
If Args(1) = "" Then
    Return False
End If
dr = dt.Find("分组 = \'" & args(0) & "\' And 权限 = \'" & args(1) & "\'")
If dr Is Nothing Then
    MessageBox.show("不存在名为""" & args(1) & "权限!","提示",MessageBoxButtons.OK,MessageBoxIcon.Information)
    Return False
End If
If dr.IsNull("用户") = False Then
    Dim nms() As String = dr("用户").Split(",")
    For Each nm As String In nms
        If nm = User.Group OrElse nm = User.Name Then \'如果授权用户包括登录用户所属的分组或其用户名
            Return True \'返回True
        End If
    Next
End If
Return False

messagebox.SHow(Functions.Execute("shouquan","我的桌面","教师通讯录"))


--  作者:anxue
--  发布时间:2013/5/28 9:06:00
--  

 下载信息  [文件大小:   下载次数: ]
图片点击可在新窗口打开查看点击浏览该文件:目录树授权57.table

如何给 学员管理  这个表 授权


--  作者:Bin
--  发布时间:2013/5/28 9:20:00
--  
参考例子 http://www.foxtable.com/bbs/dispbbs.asp?BoardID=2&ID=32903&skin=0