当我运行此示例(来自文档)时,我收到错误:
SEC-INVALIDPERM:
xdmp:document-insert("/example.xml", <a>aaa</a>, <options xmlns="xdmp:document-insert"><permissions><sec:permission xmlns:sec="http://marklogic.com/xdm...</options>)
- 无效的权限
xquery version "1.0-ml";
xdmp:document-insert(
"/example.xml",
<a>aaa</a>,
<options xmlns="xdmp:document-insert">
<permissions>{xdmp:default-permissions()}</permissions>
<collections>{
<collection>/my/additional/collection</collection>,
for $coll in xdmp:default-collections()
return <collection>{$coll}</collection>
}</collections>
<quality>10</quality>
</options>)
如果没有选项参数,该函数有效。
仅运行xdmp:default-permissions()
返回
<sec:permission xmlns:sec="http://marklogic.com/xdmp/security">
<sec:capability>update</sec:capability>
<sec:role-id>15080714410678341621</sec:role-id>
</sec:permission>
<sec:permission xmlns:sec="http://marklogic.com/xdmp/security">
<sec:capability>read</sec:capability>
<sec:role-id>15080714410678341621</sec:role-id>
</sec:permission>
如果不发生这种情况,如何将此函数与options参数一起使用?