<?xml version="1.0" encoding="UTF-8"?><api:function-page xml:base="/apidoc/8.0/xdmp.setServerFieldPrivilege.xml" generated="2015-10-07T16:36:00.016766-07:00" mode="javascript" xmlns:api="http://marklogic.com/rundmc/api"><api:function-name>xdmp.setServerFieldPrivilege</api:function-name><api:suggest>xdmp.setserverfieldprivilege</api:suggest><api:suggest>xdmp</api:suggest><api:suggest>setserverfieldprivilege</api:suggest><api:function-link mode="xquery" fullname="xdmp:set-server-field-privilege">/apidoc/8.0/xdmp:set-server-field-privilege.xml</api:function-link><api:function mode="javascript" name="setServerFieldPrivilege" type="builtin" lib="xdmp" category="AppServerBuiltins" hidden="false" bucket="MarkLogic Built-In Functions" prefix="xdmp" namespace="http://marklogic.com/xdmp" fullname="xdmp.setServerFieldPrivilege"><api:summary>
  Sets the privilege of a named server field.
</api:summary><api:params><api:param name="name" type="xs:string"><api:param-description>
    The name of the server field.</api:param-description><api:param-name>name</api:param-name><api:param-type>String</api:param-type></api:param><api:param name="privilege" type="xs:string?"><api:param-description>
    The privilege action URI for the server field.</api:param-description><api:param-name>privilege</api:param-name><api:param-type>String?</api:param-type></api:param></api:params><api:return>null</api:return><api:privilege>
  <p xmlns="http://www.w3.org/1999/xhtml"><code>http://marklogic.com/xdmp/privileges/xdmp-set-server-field-privilege</code></p>
</api:privilege><api:usage>
  <p xmlns="http://www.w3.org/1999/xhtml">Changing the server field value on a field being used with a plugin
  will change the behavior of the plugin.  Therefore, if you are using a
  server field in a plugin, it is a good practice to set a privilege on the
  server field to protect it from malicious or accidental updates.  </p>
</api:usage><api:example class="javascript"><pre xml:space="preserve" xmlns="http://www.w3.org/1999/xhtml">
xdmp.setServerFieldPrivilege("foo", 
  "http://mydomain.com/privileges/foo-server-field");
</pre></api:example></api:function></api:function-page>