xdmp.user( user as String, [extSecId as (Number|String)], [secDbFirst as Boolean] ) as (Number|String)
Returns the user ID for the specified user name. Unlike the security
library module function
sec.uidForName
,
this function
can be evaluated against any database and does not need to be evaluated
directly against the security database. It returns the user ID either from
the security database or from the specified external security, depending on
the parameter values.
// assume no external security is configured xdmp.user("sylvester") => 239871567325
xdmp.user("john", xdmp.externalSecurity("ldap-config"), false); => 16291221516538572683
Stack Overflow: Get the most useful answers to questions from the MarkLogic community, or ask your own question.