sec.userSetDefaultPermissions( user-name as String, permissions as element(sec.permission)[] ) as null
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. |
http://marklogic.com/xdmp/privileges/user-set-default-permissions
If a user with name $user-name is not found, an error is raised.
This function must be executed against the security database.
// execute this against the security database declareUpdate(); const sec = require('/MarkLogic/security.xqy'); sec.userSetDefaultPermissions( "Jim", [xdmp.permission("security", "read","element"), xdmp.permission("security", "update","element")]) // Sets the security(read) and security(update) permissions for user, "Jim."