Is the author of the document the verification method?

Hi, Domino programmers!

I am working on a lotus database + xpages and I am having the following problem:

I have authors and readers fields on the document, and both can contain users and groups. Both fields are set in XPage using the NamePicker control. When the document is saved, I would like to hide the "Edit" button when the user does not have rights to this.

Is there a way to simply check a document, data source or context - if the current user is the author of the document? Or should I check all this for a long time by comparing the authors' fields - multiple usernames and groups with the current username?

Any help would be appreciated.

+8
author lotus-domino xpages lotus-notes lotus
source share
1 answer

You can use the Java method NotesContext.isDocEditable(document) to check if the user can edit the document.

In SSJS you can do this:

 var ctx = com.ibm.domino.xsp.module.nsf.NotesContext.getCurrent(); return ctx.isDocEditable(doc); 

This method is also available as XSnippet .

+20
source share

All Articles