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

isDocEditable - the hidden "swiss knife"

Oliver Busse on 09/25/2013 22:33:59 CEDT, 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