xdmp:userid-roles( $userId as xs:unsignedLong, [$extSecId as xs:unsignedLong], [$secDbFirst as xs:boolean] ) as xs:unsignedLong*
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:user-roles(83928739123) => (2349872340, 432987324)
Stack Overflow: Get the most useful answers to questions from the MarkLogic community, or ask your own question.