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.