Loading TOC...

rdt.ruleValidate

rdt.ruleValidate(
   $rule-collection as String[]
) as Sequence

Summary

Validate the redaction rules in one or more redaction rule collections and return the URIs of the rule documents validated.

Parameters
$rule-collection The URIs of the collections that contains the redaction rules to be validated. The collections must not contain any non-rule documents.

Required Privileges

This operation requires the redaction-user role or the following privilege:

http://marklogic.com/xdmp/privileges/redaction-user

Usage Notes

Use this function to perform validation of redaction rules. Rules are identified by the rule collection to which they belong. If all rules validate successfully, this function returns a list of the validated rule URIs. If any rule is invalid, this function throws the exception RDT-BADRULE. If a rule names a custom redaction for a module that is not installed in MarkLogic, the exception RDT-MODNOTFOUND is thrown.

Validation does not check the contents of the options section of a rule because this data is redaction-function specific, rather than a general characteristic of all redaction rules. If the rule uses dictionary-based masking, no validation is performed on the dictionary.

The collection(s) can contain XML rules, JSON rules, or both, but must not contain non-rule documents.

See Also

Example


var rdt = require('/MarkLogic/redaction.xqy')
rdt.ruleValidate(["pii-conceal", "obscure-loc"])

// Result: Assuming the rules in the "pii-conceal" and "obscure-loc"
// collections are valid, the URIs of all the rule documents in these
// collections.
  

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