
sec.roleSetExternalNames( role-name as String, external-name as String[] ) as null
This function sets a role to be matched to one or more external LDAP distinguished names.
| Parameters | |
|---|---|
| role-name | The role to be set for the external user. | 
| external-name | A sequence of one or more external LDAP distinguished names to be associated with the named role. | 
(: 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:role-set-external-names("admin", ("UID=joe,CN=Users,DC=MARKLOGIC1,DC=COM"))
(: Sets the external LDAP distinguished name for the "admin" role to 
   "UID=joe,CN=Users,DC=MARKLOGIC1,DC=COM". :)
    
  
    // execute this against the Security database
    declareUpdate();
    const sec = require('/MarkLogic/security.xqy');
    
    sec.roleSetExternalNames("admin", ("UID=joe,CN=Users,DC=MARKLOGIC1,DC=COM"));
    // Sets the external LDAP distinguished name for the "admin" role to "UID=joe,CN=Users,DC=MARKLOGIC1,DC=COM".
   
      
  
Stack Overflow: Get the most useful answers to questions from the MarkLogic community, or ask your own question.