Function to check rights of a document

When users open an agent via web - with “Run as web user” set - and they have rights to save the document managed by the agent, agent has to display some information, otherwise nothing. My problem is “how can I check if a user has the rights to modify/save document”. Inside doc there is an Author field, but this field can have roles, user names, groups, so I think it’s not possible to check recursively that field. Is there a simple function that help me check if I user can change/save doc or not? I found a trick to check that info, but I don’t like it, because as a drawback I change the modification date of doc. Here it is the code:

On Error 4000 Goto isNotAuthor

Dim doc as NotesDocument

doc.Author = doc.Author 'Modifico il documento

if (doc.save(True,True)) Then

End if

isNotAuthor:

I change a doc and assign a field its value then try to save. If user can save the doc, that’s OK - but the modification date changes, otherwise an error 4000 raises and execution jump to label isNotAuthor.

Have you got suggestions or a solution?

Thanks a lot

Subject: Function to check rights of a document

Hi,

“Inside doc there is an Author field, but this field can have roles, user names, groups,…”

This function “@UserNamesList” returns : user names, roles et groups of current user, so you can create a formula (e.g. in compute for display field) to check Author field…

HTH,

Thierry