If User.IsRole("资料下载") Then '如果用户具有资料下载权限,则执行
If e.Col.Name = "文件名称及链接" Then
If e.Row.IsNull("文件名称及链接") = False Then
e.cancel = True
Dim c As Col = e.Col
Dim ftp As FTPClient = c.DataCol.FTPClient
Dim path As String = ProjectPath & "RemoteFiles\" & FileSys.GetName(e.Row(c.Name))
ftp.Download(e.Row(c.Name), path, True)
Dim proc As new Process
proc.File = path
proc.Start
End If
End If
Else
If e.Table.Current("特需授权").Contains("User.Name") Then '如果当前用户不具备资料下载权限,但是包含在特需授权中 这个判断没有起作用
If e.Row.IsNull("文件名称及链接") = False Then
e.cancel = True
Dim c As Col = e.Col
Dim ftp As FTPClient = c.DataCol.FTPClient
Dim path As String = ProjectPath & "RemoteFiles\" & FileSys.GetName(e.Row(c.Name))
ftp.Download(e.Row(c.Name), path, True)
Dim proc As new Process
proc.File = path
proc.Start
End If
Else
If e.Col.Name = "文件名称及链接" Then
MessageBox.Show("你没有打开资料的权限!")
End If
End If
End If
这样写按判断逻辑应该是没有问题的,但是当用户名包含在“特需授权”里面,还是提示没有打开资料的权限,是不是e.Table.Current("特需授权").Contains("User.Name") 这里错了?
我要判断的是,当前用户点击的这一行的“特需授权”列里面是否有这个用户的用户名。
[此贴子已经被作者于2016/8/19 9:26:44编辑过]