Skip to content

Commit

Permalink
Added configuration of response code to documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
franciscogouveia committed Mar 1, 2016
1 parent 5720a71 commit d7236b3
Showing 1 changed file with 20 additions and 4 deletions.
24 changes: 20 additions & 4 deletions API.md
Expand Up @@ -3,14 +3,15 @@

* [`Terms`](#terms)
* [`Setting up a policy`](#setting-up-a-policy)
* [`Target`](#target)
* [`Policy Set`](#policy-set)
* [`Policy`](#policy)
* [`Target`](#target-matching)
* [`Rule`](#rule)
* [`Policy`](#policy)
* [`Policy Set`](#policy-set)
* [`Configuration`](#configuration)
* [`Global policy`](#global-policy)
* [`Route policy`](#route-policy)
* [`Dynamic policy`](#dynamic-policy)
* [`Response code`](#defining-the-response-code)

# hapi-rbac

Expand Down Expand Up @@ -483,10 +484,25 @@ server.route({
```


### Defining the response code

When importing the `hapi-rbac` plugin, it is possible to define what are the response codes for `deny` and `undetermined` cases:

```js
server.register({
register: require('hapi-rbac'),
options: {
responseCode: {
onDeny: 403,
onUndetermined: 403
}
}
}, function(err) {
...
});
```


This configuration is applied to all the cases.



Expand Down

0 comments on commit d7236b3

Please sign in to comment.