Hi,
sitze mal wieder über einem Problem und finde keine Antwort, warum das nicht funktioniert.

Es sollen nur bestimmte Dokumente gelöscht werden dürfen (basierend auf dem Formname).
Wenn jedoch der User die Rolle [Admin] hat, soll er alle Dokumente löschen dürfen.
| Sub Querydocumentdelete(Source As Notesuidatabase, Continue As Variant) |
| Dim session As New NotesSession |
| Dim db As NotesDatabase |
| Dim roles As Variant |
| Dim collection As NotesDocumentCollection |
| Dim i As Integer |
| Dim doc As notesdocument |
| Dim strForm As String |
| |
| Set db = session.CurrentDatabase |
| roles = db.QueryAccessRoles(session.UserName) |
| |
| For i = 0 To Ubound(roles) |
| If roles(i) Like "[Admin]" Then |
| Exit Sub |
| End If |
| Next |
| |
| Set collection = source.Documents |
| For i = 1 To collection.Count |
| Set doc = collection.GetNthDocument(i) |
| strForm = doc.getitemvalue ("Form")(0) |
| If strForm = "frmStructure" Then |
| Call doc.Lock () |
| Else |
| continue = False |
| End If |
| Next |
| End Sub |
Leider erkennt Like die Rolle nicht, obwohl es im Debugger genauso aussieht.
Habt ihr da ev. noch eine Idee?
Grüße
Sebastian