Loading TOC...

sec:user-set-default-permissions

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

Summary

Sets the default permissions for a user with name $user-name.

Parameters
user-name The name of the user.
permissions New permissions. If the empty sequence is provided, deletes the existing permissions.

Required Privileges

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

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-permissions(
   "Jim", 
    (xdmp:permission("security", "read"),
     xdmp:permission("security", "update")))

(: Sets the security(read) and security(update) permissions for user, "Jim." :)
 

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