xdmp.useridRoles( userId as (Number|String), [extSecId as (Number|String)], [secDbFirst as Boolean] ) as Sequence
Returns all roles assigned to a user, including roles directly assigned to the user and roles inherited by other roles. Returns role IDs for users from the security database or from the specified external security, depending on the parameter values.
xdmp.userRoles(83928739123); => [2349872340, 432987324]
Stack Overflow: Get the most useful answers to questions from the MarkLogic community, or ask your own question.