ForbesLindesay/connect-roles — pull request #35 by ariutta (2014-10-13 04:56:45+00:00)
Title: Made res available in user.use(req, res)

Hello,

This is a small update to make ```res``` available in ```user.use(req, res)```. My use case is to add a function to res like this:

```
var filter = require('json-schema-filter');
var fs = require('fs');
var highland = require('highland');

user.use('access private page', function (req, res) {
if (req.user.role === 'moderator') {
var moderatorFilter = highland.curry(filter, JSON.parse(fs.readFileSync('./authorization-schemas/moderator.json', {encoding: 'utf8'})));
res.jsonAuthorized = highland.compose(res.json, moderatorFilter);
return true;
}
});
```