jj für MS 25.01.17
This commit is contained in:
@@ -2168,59 +2168,11 @@ Public Class ClassWindream
|
||||
ElseIf input.ToString.EndsWith("(" & i.ToString & ")") Then
|
||||
input = input.ToString.Replace("(" & i.ToString & ")", "")
|
||||
End If
|
||||
|
||||
Next
|
||||
|
||||
Return input
|
||||
Catch ex As Exception
|
||||
ClassLogger.Add("Error in CheckIndexValue: " & ex.Message)
|
||||
Return Nothing
|
||||
End Try
|
||||
|
||||
End Function
|
||||
Public Shared Function Get_File_Rights(filepath As String)
|
||||
Try
|
||||
If IsNothing(oSession) Then
|
||||
If Init() = False Then
|
||||
MsgBox("Error in Init windream - check the log for further information!", MsgBoxStyle.Exclamation)
|
||||
Return Nothing
|
||||
End If
|
||||
End If
|
||||
|
||||
Dim oWMObject As WINDREAMLib.WMObject
|
||||
Dim file = filepath.Substring(2)
|
||||
oWMObject = oSession.GetWMObjectByPath(WINDREAMLib.WMEntity.WMEntityDocument, filepath.Substring(2))
|
||||
If Not IsNothing(oWMObject) Then
|
||||
Dim AccessRightsObject
|
||||
AccessRightsObject = oWMObject.GetWMObjectRelationByName(REL_Document_AccessRight)
|
||||
Dim _msg As String
|
||||
For Each aRightRelation In AccessRightsObject
|
||||
dwAccessRight = aRightRelation.GetVariableValue(COL_AccessRight_AccessRight) 'COL_AccessRight_AccessRight)
|
||||
Dim UserGroupRelation = aRightRelation.GetWMObjectRelationByName(REL_AccessRight_UserOrGroup)
|
||||
Dim UserOrGroup = UserGroupRelation.item(0).aName
|
||||
If UserOrGroup.ToString.ToLower.Contains(USER_USERNAME.ToLower) Then
|
||||
If dwAccessRight And WMAccessRightRead Then
|
||||
_msg = "R"
|
||||
End If
|
||||
If dwAccessRight And WMAccessRightWrite Then
|
||||
_msg = _msg & "W"
|
||||
End If
|
||||
If dwAccessRight And WMAccessRightAdmin Then
|
||||
_msg = _msg & "A"
|
||||
End If
|
||||
End If
|
||||
|
||||
Next
|
||||
Return _msg
|
||||
Else
|
||||
MsgBox("Could not create a windream-object!", MsgBoxStyle.Exclamation)
|
||||
Return Nothing
|
||||
End If
|
||||
|
||||
|
||||
Catch ex As Exception
|
||||
ClassLogger.Add("Unexpected Error in Get_File_Rights: " & ex.Message)
|
||||
Return Nothing
|
||||
End Try
|
||||
End Function
|
||||
End Class
|
||||
|
||||
Reference in New Issue
Block a user