DocumentPropertyMenu: Load depending on access rights
This commit is contained in:
@@ -5,6 +5,7 @@ Imports DigitalData.Modules.Logging
|
|||||||
Imports DigitalData.Modules.Windows.NativeMethods
|
Imports DigitalData.Modules.Windows.NativeMethods
|
||||||
Imports DigitalData.Modules.Windows.File
|
Imports DigitalData.Modules.Windows.File
|
||||||
Imports DigitalData.Modules.ZooFlow
|
Imports DigitalData.Modules.ZooFlow
|
||||||
|
Imports DigitalData.Modules.EDMI.API.Rights
|
||||||
|
|
||||||
Public Class DocumentPropertyMenu
|
Public Class DocumentPropertyMenu
|
||||||
Private ReadOnly _Logger As Logger
|
Private ReadOnly _Logger As Logger
|
||||||
@@ -29,26 +30,32 @@ Public Class DocumentPropertyMenu
|
|||||||
_File = New Modules.Windows.File(LogConfig)
|
_File = New Modules.Windows.File(LogConfig)
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Public Function GetMenuItems(IsLegacy As Boolean) As List(Of DXMenuItem)
|
Public Function GetMenuItems(IsLegacy As Boolean, AccessRight As AccessRight) As List(Of DXMenuItem)
|
||||||
If IsLegacy Then
|
If IsLegacy Then
|
||||||
Return GetLegacyMenuItems()
|
Return GetLegacyMenuItems()
|
||||||
Else
|
Else
|
||||||
Return GetIDBMenuItems()
|
Return GetIDBMenuItems(AccessRight)
|
||||||
End If
|
End If
|
||||||
End Function
|
End Function
|
||||||
|
|
||||||
Public Function GetIDBMenuItems() As List(Of DXMenuItem)
|
Public Function GetIDBMenuItems(AccessRight As AccessRight) As List(Of DXMenuItem)
|
||||||
Dim oOpenFile = New DXMenuItem(OPEN_FILE, AddressOf OpenFile_Click)
|
Dim oOpenFile = New DXMenuItem(OPEN_FILE, AddressOf OpenFile_Click)
|
||||||
Dim oOpenFolder = New DXMenuItem(OPEN_DIRECTORY, AddressOf OpenFolder_Click)
|
Dim oOpenFolder = New DXMenuItem(OPEN_DIRECTORY, AddressOf OpenFolder_Click)
|
||||||
Dim oCopyPath = New DXMenuItem(COPY_PATH, AddressOf CopyPath_Click)
|
Dim oCopyPath = New DXMenuItem(COPY_PATH, AddressOf CopyPath_Click)
|
||||||
Dim oProperties = New DXMenuItem(OPEN_PROPERTIES, AddressOf Properties_Click)
|
Dim oProperties = New DXMenuItem(OPEN_PROPERTIES, AddressOf Properties_Click)
|
||||||
|
|
||||||
Return New List(Of DXMenuItem) From {
|
If AccessRight = AccessRight.VIEW_ONLY Then
|
||||||
oOpenFile,
|
Return New List(Of DXMenuItem) From {
|
||||||
oOpenFolder,
|
oProperties
|
||||||
oCopyPath,
|
}
|
||||||
oProperties
|
Else
|
||||||
}
|
Return New List(Of DXMenuItem) From {
|
||||||
|
oOpenFile,
|
||||||
|
oOpenFolder,
|
||||||
|
oCopyPath,
|
||||||
|
oProperties
|
||||||
|
}
|
||||||
|
End If
|
||||||
End Function
|
End Function
|
||||||
|
|
||||||
Public Function GetLegacyMenuItems() As List(Of DXMenuItem)
|
Public Function GetLegacyMenuItems() As List(Of DXMenuItem)
|
||||||
@@ -66,7 +73,7 @@ Public Class DocumentPropertyMenu
|
|||||||
End Function
|
End Function
|
||||||
|
|
||||||
Public Sub Properties_Click(sender As Object, e As EventArgs)
|
Public Sub Properties_Click(sender As Object, e As EventArgs)
|
||||||
If TestObjectIdExists(OPEN_PROPERTIES) Then
|
If TestObjectIdExists(OPEN_PROPERTIES) = False Then
|
||||||
Exit Sub
|
Exit Sub
|
||||||
End If
|
End If
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user