<?xml version="1.0" encoding="UTF-8"?><api:function-page xml:base="/apidoc/8.0/xdmp.privilege.xml" generated="2015-10-07T16:36:00.016766-07:00" mode="javascript" xmlns:api="http://marklogic.com/rundmc/api"><api:function-name>xdmp.privilege</api:function-name><api:suggest>xdmp.privilege</api:suggest><api:suggest>xdmp</api:suggest><api:suggest>privilege</api:suggest><api:function-link mode="xquery" fullname="xdmp:privilege">/apidoc/8.0/xdmp:privilege.xml</api:function-link><api:function mode="javascript" name="privilege" type="builtin" lib="xdmp" category="Security" hidden="false" bucket="MarkLogic Built-In Functions" prefix="xdmp" namespace="http://marklogic.com/xdmp" fullname="xdmp.privilege"><api:summary>
  Returns the privilege ID for the specified privilege name.  Unlike the security
  library module function <code xmlns="http://www.w3.org/1999/xhtml">sec:uid-for-name</code>, this function
  can be evaluted against any database and does not need to be evaluated
  directly against the security database.  It returns the privilege ID from the
  security database configured for the database in which the App Server
  evaluates against.
</api:summary><api:params><api:param name="action" type="xs:string"><api:param-description>
    A privilege action.
  </api:param-description><api:param-name>action</api:param-name><api:param-type>String</api:param-type></api:param><api:param name="kind" type="xs:string"><api:param-description>
    A privilege kind: "execute" or "URI".
  </api:param-description><api:param-name>kind</api:param-name><api:param-type>String</api:param-type></api:param></api:params><api:return>String</api:return><api:example class="javascript"><pre xml:space="preserve" xmlns="http://www.w3.org/1999/xhtml">
xdmp.privilege("http://my-app/test","execute");
=&gt; 2392349873545
</pre></api:example></api:function></api:function-page>