updated doc + bumped version

This commit is contained in:
Theodor Diaconu 2016-09-24 08:12:43 +03:00
parent 4f9a050ee1
commit 9acaf43e59
3 changed files with 7 additions and 5 deletions

View file

@ -12,7 +12,8 @@ Exposing a collection does the following things:
```
Collection.find(filters, options, userId);
```
- Important note: If userId is undefined, the firewall and constraints will not be applied. If the userId is null, they will be applied. This is to allow server-side fetching without any restrictions.
*Important Note:* If *userId* is undefined, the firewall and constraints will not be applied. If the *userId* is *null*, the firewall will be applied. This is to allow server-side fetching without any restrictions.
Exposing a collection to everyone
@ -60,9 +61,11 @@ When querying for a data-graph like:
}
```
It is not necessary to have an exposure for *comments*, however if I do have it, and it has a firewall. The firewall will be called.
It is not necessary to have an exposure for *comments*, however if you do have it, and it has a firewall. The firewall will be called.
The reason for this is security.
Note: Don't worry about performance. We went great lengths to retrieve data in as few MongoDB requests as possible, in the scenario above,
if you do have a firewall for users and comments, both will be called only once, because we only make 2 MongoDB requests.
Global Exposure Configuration
-----------------------------

View file

@ -1,4 +1,3 @@
import { restrictFields } from 'meteor/cultofcoders:grapher';
import { Exposure } from 'meteor/cultofcoders:grapher';
Exposure.setConfig({
@ -31,7 +30,7 @@ Demo.insert({
Demo.expose({
firewall(filters, options, userId) {
restrictFields(filters, options, ['restrictedField']);
Exposure.restrictFields(filters, options, ['restrictedField']);
filters.isPrivate = false;
},

View file

@ -1,6 +1,6 @@
Package.describe({
name: 'cultofcoders:grapher',
version: '1.1.0',
version: '1.1.1',
// Brief, one-line summary of the package.
summary: 'Grapher makes linking collections easily. And fetching data as a graph.',
// URL to the Git repository containing the source code for this package.