MarkLogic 12 EA 1 Product Documentation
sec.getUserNames

sec.getUserNames(
   user-ids as (Number|String)[]
) as Sequence

Summary

Returns sequence of unique sec:user-names that corresponds to the sequence of user IDs $user-ids. Duplicate IDs return a single name.

Parameters
user-ids A sequence of user IDs.

Required Privileges

http://marklogic.com/xdmp/privileges/get-user-names

Usage Notes

If a user ID in $user-ids does not correspond to an existing user, an error is returned.

This function must be executed against the security database.

Example


// execute this against the security database
// There is no JSON output for this function.

const sec = require('/MarkLogic/security.xqy');

sec.getUserNames([18325468190304151823, 
                    5673246250406350379, 
                    11765239768744971597])

=> 

<sec:user-name xmlns:sec="http://marklogic.com/xdmp/security">Jim</sec:user-name>
<sec:user-name xmlns:sec="http://marklogic.com/xdmp/security">Sue</sec:user-name>
<sec:user-name xmlns:sec="http://marklogic.com/xdmp/security">Tom</sec:user-name>
    
Powered by MarkLogic Server | Terms of Use | Privacy Policy