how to check whether a user is able to update or insert any document in marklogic database or not ?
For example , there are 4 user and some have permission to update and some have permission to read document in marklogic database
try{
let $uri := abc.xml
let $doc : <a/>
if (condition)
then check whether the current user is able to update or insert the doc in marklogic or not , if it is not then throw fn:error()
else
xdmp:document-insert($uri,$doc) (:it will throw error, when user have no permission to insert the doc:)
}
catch($e)
{$e}
