The MarkLogic database with temporal functionality contains data with permissions assigned to specific roles. However, we now need to grant read access to a particular role for temporal documents. I have attempted to utilize a MarkLogic function to enable this read permission.
具有临时功能的MarkLogic数据库包含具有分配给特定角色的权限的数据。但是,我们现在需要为临时文档授予特定角色的读取访问权限。我已尝试使用MarkLogic函数来启用此读取权限。
xdmp:document-add-permissions(
"/entities/abc.xml",
(xdmp:permission("read-user", "read"))
)
But getting the below error:
但得到以下错误:
1.0-ml] SEC-TEMPORALDOC: xdmp:document-add-permissions("/entities/abc.xml",
<sec:permission xmlns:sec="http://marklogic.com/xdmp/security">
sec:capability...</sec:capability>...</sec:permission>)
-- Cannot perform non-temporal operation on document in temporal collection
Kindly suggest how can I provide the new permissions on temporal documents.
请建议我如何在临时文档上提供新权限。
更多回答
优秀答案推荐
As the error message states, you cannot perform non-temporal operations on temporal documents.
正如错误消息所述,您不能对临时文档执行非临时操作。
Use the temporal function temporal:document-insert()
and set the appropriate options with the permissions you want to set.
使用临时函数Temporal:Document-Insert(),并使用您想要设置的权限设置适当的选项。
更多回答
我是一名优秀的程序员,十分优秀!