All blog posts, code samples and downloads licensed under Apache License 2.0.
Close

isDocEditable - the hidden "swiss knife"

Oliver Busse on 25.09.2013 20:33:59 GMT, filed under SSJS XSP 

Hail to @PaulSWithers and @NathanTFreeman! They showed me the solution for displaying controls (e.g. an edit button) only when the user effectivly has the ability to edit the document, depending on the ACL and author fields.

var ctx = com.ibm.domino.xsp.module.nsf.NotesContext.getCurrent()
return ctx.isDocEditable(currentDocument.getDocument()) && !currentDocument.isEditable()

Place this code in the "rendered" property of your edit button to show/hide it when it is logical L├Ąchelnd


Tagged with xpage