From 9acaf43e593e7215408f306a55eb5a4f0a49aebf Mon Sep 17 00:00:00 2001 From: Theodor Diaconu Date: Sat, 24 Sep 2016 08:12:43 +0300 Subject: [PATCH] updated doc + bumped version --- docs/exposure.md | 7 +++++-- lib/exposure/testing/bootstrap/fixtures.js | 3 +-- package.js | 2 +- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/docs/exposure.md b/docs/exposure.md index 6c4e431..8bafed8 100644 --- a/docs/exposure.md +++ b/docs/exposure.md @@ -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 ----------------------------- diff --git a/lib/exposure/testing/bootstrap/fixtures.js b/lib/exposure/testing/bootstrap/fixtures.js index 3126d54..06244ed 100644 --- a/lib/exposure/testing/bootstrap/fixtures.js +++ b/lib/exposure/testing/bootstrap/fixtures.js @@ -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; }, diff --git a/package.js b/package.js index cb8fc90..8565dd1 100644 --- a/package.js +++ b/package.js @@ -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.