Loading TOC...

MarkLogic Server 11.0 Product Documentation
sec:user-set-default-collections

sec:user-set-default-collections(
   $user-name as xs:string,
   $collections as xs:string*
) as empty-sequence()

Summary

Sets the default collections of a user with name $user-name to $collections.

Parameters
user-name The name of a user.
collections A sequence of collections.

Required Privileges

http://marklogic.com/xdmp/privileges/user-set-default-collections

Usage Notes

If a user with name $user-name is not found, an error is raised.

This function must be executed against the security database.

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-default-collections("Jim", 
    ("http://marklogic.com/jim_modules", 
     "http://marklogic.com/jim_docs"))

(: Sets the default collections for the user, "Jim," to "http://marklogic.com/jim_modules"
   and "http://marklogic.com/jim_docs". Any other previously set collections are removed.
  

Stack Overflow iconStack Overflow: Get the most useful answers to questions from the MarkLogic community, or ask your own question.