Wir haben kürzlich (und endlich!) einen interessanten Umstand identifiziert der uns nun ein paar Jahre das Leben schwer gemacht hat.
Wenn ein Benutzer (1) ein Profildokument benutzt, das mit Leser-/Autor-Feldern geschützt ist, kann ein anderer Benutzer (2) keine (beliebigen) Agenten mehr aufrufen. Der Verdacht liegt nahe, dass bereits beim Aufruf eines beliebigen Agenten der Zugriff auf ein durch den HTTP-Task gecachte(s) Profildokument(e) erfolgt, nicht erst beim beabsichtigten Zugriff darauf.
Bei uns tritt das produktiv in XPages und NotesAgent.runWithDocumentContext auf, kann aber auch mit klassische Webagenten nachvollzogen werden.
Das Problem ist uns seit mindestens Version 12.x.x bekannt. Aufgrund der Komplexität der Anwendung ist es uns jedoch erst kürzlich gelungen, es auf Profildokumente einzugrenzen. Support request ist gestellt, dachte ich erzähl es mal hier noch.
Ein kurzes Video gibts hier https://youtu.be/EA4Ggd0rfig (https://youtu.be/EA4Ggd0rfig) und Beispieldatenbank im Anhang.
-----------------
Beschreibung aus unserem Bug Report
Web agents / HTTP: If one user (1) uses a profile document that is protected with
reader/author fields, this prevents another user (2) from calling up agents.
Reproductions:
- Make example database available on an Domino Server with webaccess (sign agents etc.)
- You need two users (1 & 2) with author access to database, Anonymous has no access
- For faster reproduction, set HTTP thread limit to 1
(Server Document - Internet Protocols - HTTP - Number active threads - 1 == (Domino HTTP Task restart)
- Call 'LS Initialize Profile Doc' (init) Agent from web with user 1
- Use another browser / privacy mode for opening "LS Random Agent" (agent) with user 2
- User 2 should now see "You are not authorized to perform that operation"
Notes:
- Time is a factor, you might need to play around with both agents (usually less than a minute)
- To reset and reproduce just restart your http task
- The behaviour of a user has a direct impact on the functionality of the whole application.
- In production, there are of course many more HTTP tasks running - this leads to the error occurring completely randomly.
Agent Initialize (min)
Option Public
Option Declare
Sub Initialize
Dim sess As New notessession
Dim doc As NotesDocument
Dim IsNew As boolean
Set doc = sess.Currentdatabase.Getprofiledocument("testProfileLS", sess.Effectiveusername)
IsNew = doc.Isnewnote
Print "Content-type: text/plain" & Chr(10)
Print "Unid: " & doc.Universalid & " | Name: " & doc.Getitemvalue("$Name")(0) & " " & Now & Chr(10)
doc.Replaceitemvalue("AccessServer", "[Server]").Isreaders = True
doc.Replaceitemvalue("AccessAdmin", "[Administrator]").Isreaders = True
doc.Replaceitemvalue("AccessReader", sess.Effectiveusername).Isreaders = True
doc.Replaceitemvalue("AccessAuthor", sess.Effectiveusername).Isauthors = True
if doc.save(True,False) Then
If IsNew Then
Print "Profile doc created "
Else
Print "Profile doc updated "
End If
Else
Print "Profile doc save failed "
End If
Exit Sub
errsec:
Print "Runtime Error in line " & Erl & " :" & error
Exit sub
End Sub
Random Agent
Option Public
Option Declare
Sub Initialize
Print "Random Webagent, " & now
End Sub