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