MarkLogic 12 EA 1 Product Documentation
sec:user-get-roles

sec:user-get-roles(
   $user-name as xs:string
) as xs:string*

Summary

Returns a sequence of role names for the roles directly assigned to the user ($user-name). Does not flatten the roles to include "inherited roles."

If a user with name equal to $user-name is not found, an error is returned.

Parameters
user-name The name of a user.

Required Privileges

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

Usage Notes

This function must be executed against the security database.

Example


(: execute this against the security database :)
xquery version "1.0-ml";
import module namespace sec="http://marklogic.com/xdmp/security" at 
    "/MarkLogic/security.xqy";
   
sec:user-get-roles("Jim")
=>

Developer
admin
admin-builtins
  
Powered by MarkLogic Server | Terms of Use | Privacy Policy