Loading TOC...

MarkLogic 12 EA 1 Product Documentation
sec.ampGetRoles

sec.ampGetRoles(
   namespace as String,
   local-name as String,
   document-uri as String,
   database as (Number|String)
) as Sequence

Summary

Returns a sequence of role names for the roles directly assigned to the amp ($namespace, $local-name, $document-uri).

Parameters
namespace Namespace of the function to which the amp applies.
local-name Name of function to which the amp applies.
document-uri URI of the document in which the function is located.
database Database ID in which the module is located. If the module is on the filesystem (in the Modules directory), specify xs:unsignedLong(0).

Required Privileges

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

Usage Notes

If an amp is not found with the given identifiers, an error is returned.

This function must be executed against the security database.

Example


// execute this against the security database
 
const sec = require('/MarkLogic/security.xqy');
 
sec.ampGetRoles(
    "http://marklogic.com/my_modules/myspace",
    "my-amp",
    "/MarkLogic/MyModule.xqy",
    0)
=>

Contractor
Developer
Temporary
  

Stack Overflow iconStack Overflow: Get the most useful answers to questions from the MarkLogic community, or ask your own question.