Way to check is an user a document author?

守給你的承諾、 提交于 2019-12-05 20:48:24

问题


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.


回答1:


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.



来源:https://stackoverflow.com/questions/21853322/way-to-check-is-an-user-a-document-author

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!