mirror of
https://github.com/vale981/grapher
synced 2025-03-04 17:11:38 -05:00
updated doc + bumped version
This commit is contained in:
parent
4f9a050ee1
commit
9acaf43e59
3 changed files with 7 additions and 5 deletions
|
@ -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
|
||||
-----------------------------
|
||||
|
|
|
@ -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;
|
||||
},
|
||||
|
|
|
@ -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.
|
||||
|
|
Loading…
Add table
Reference in a new issue