deny() Function
The deny() function denies a request immediately and halts execution. You can specify a message, reason and code via the parameters, which will printed to the client. In controller policies, dency() will only log the request to the violations log of a policy.
Deny Behaviour
You can specify what action deny should do by using the spec.violationPolicy in a JsPolicy. Valid options are Deny (default), Warn or Dry
Example#
This example shows how deny can be used.