MarkLogic 12 EA 1 Product Documentation
sec:user-set-query

sec:user-set-query(
   $user-name as xs:string,
   $capability as xs:string,
   $query as cts:query?
) as empty-sequence()

Summary

Sets the $capability query of a user with $user-name to $query.

Parameters
user-name The name of a user.
capability The name of the capability.
query A query for the given capability of the user.

Required Privileges

http://marklogic.com/xdmp/privileges/user-set-queries

Usage Notes

This function must be executed against the security database. If a user with name $user-name is not found, an error is raised.

Example


(: execute this against the security database :)
xquery version "1.0-ml"; 
import module namespace sec = "http://marklogic.com/xdmp/security" 
  at "/MarkLogic/security.xqy"; 
  
sec:user-set-query(
  "Mike", 
  "read", 
  cts:word-query(("MarkLogic", "database"))
)

(: Set the user query of the capability "read" for the user "Mike" :)
  
Powered by MarkLogic Server | Terms of Use | Privacy Policy