couchbase/sync_gateway — pull request #286 by jnordberg (2014-03-04 07:53:51+00:00)
Title: Add have* functions to sync function scope

Add `haveUser`, `haveRole` and `haveAccess` functions that can be used in the sync function.

Example use case:

```javascript
// only doc.members and admins can modify the document
if (!haveUser(oldDoc.members) && !haveRole('admin')) {
throw ({forbidden: "no access"});
}
```