检查当前用户是否是文档的作者 [英] checking if current user is author of the document

查看:54
本文介绍了检查当前用户是否是文档的作者的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个formA,其中我有一个字段'_author',该字段的类型为Authors/Computed,显示为值(@Subset($ Updatedby; 1)).我在viewA上显示来自formA的信息.我要实现的是,您自己创建的文档仅在viewA上对您自己可见.我在viewA视图选择"中尝试了以下公式: 选择(form ="formA"&@UserName = _author).即使我从文档属性中读取这两个变量时都知道它们具有相同的值,但条件还是无法满足,并且看不到单个文档.如果删除&"之后的所有内容,该视图将显示所有文档. 全部托管在处理用户的服务器上.

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.

推荐答案

一个方便的解决方法是创建带有嵌入式视图的Page.此视图与您的视图完全相同,但在字段_author中还有一个第一列(!)列.

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.

根据已分类列_author的格式,将公式@UserName@Name([CN]; @UserName)放入嵌入式视图的属性显示单个类别".然后始终显示页面而不是视图.

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.

这篇关于检查当前用户是否是文档的作者的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆