Way to check is an user a document author?

Hello Domino programmers!

I work on a lotus database + xpages and i ran into a following problem:

I have Authors and Readers fields on document and both can contain users and groups. Both fields are set on XPage using NamePicker control. When document is saved i would like to hide an "Edit" button when user doesn't have rights to do so.

Is there a way to just check on document, datasource or context - if current user is document author? Or i have to check it all way long, comparing Authors fields - multiple usernames and groups with current username?

Any help will be appreciated.


You can use the Java method NotesContext.isDocEditable(document) to check if 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 an XSnippet.

Need Your Help

Is it worth the effort to try to reduce JSON size?

json performance http bandwidth

I am submitting relatively lots of data from a mobile application (up to 1000 JSON objects), that I would normally encode like this: