checking if current user is author of the document

自闭症网瘾萝莉.ら 提交于 2019-12-20 04:32:07

问题


I have a formA where I have a field '_author' which is of type Authors/Computed for display with value (@Subset($Updatedby;1)). I display information from formA on viewA. What I want to achieve is that documents that are created by you are only visible to yourself on viewA. I tried the following formula in viewA 'View Selection': SELECT (form = "formA" & @UserName =_author). Even though I know that these two variables have the same values when I read it from the document's properties, the condition is not satisfied and I do not see a single document. If I delete everything after "&", the view shows all documents. All is hosted on a server which handles users.


回答1:


A handy workaround is to create a Page with an embedded view. This view is exactly like your view but has an additional first categorized (!) column with your field _author.

Put into embedded view's property "Show single category" the formula @UserName or @Name([CN]; @UserName) depending on how your categorized column _author is formatted. Show then always the Page instead of the view.

This way you avoid trouble with "Shared, private on first use" views and users see exactly their own documents only.




回答2:


@UserName works in a special manner in selection formulas in views. In your case the view should be Private on First Use. Read further here: http://www-01.ibm.com/support/docview.wss?uid=swg21089773 .

Be aware that this lead to all sort of issues, e.g. when you update the design of the view users must remove the view manually to get the changes deployed.



来源:https://stackoverflow.com/questions/21705858/checking-if-current-user-is-author-of-the-document

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