cult-of-coders / grapher

Grapher: Meteor Collection Joins + Reactive GraphQL like queries
https://atmospherejs.com/cultofcoders/grapher
MIT License
275 stars 53 forks source link

Allow removing global exposure linked firewalls #412

Closed Floriferous closed 4 years ago

Floriferous commented 4 years ago

We've found global exposure to be extremely useful for our admin apps that can access all the data. It gives all the power to the front-end to query whatever it wants, while also knowing in this part of our app that there will be no abuse, so we don't have to restrict anything in the global exposure either.

It'd be useful for global exposures to be able to skip the linked firewalls. Especially when performing large nested queries, as the firewalls are called a lot, and I'm hoping to improve global query performance with this change.

Floriferous commented 4 years ago

The solution is this:

    Collection.expose({
      firewall(filters, options, userId) {},
      publication: true,
      method: true,
      blocking: false,
      body: () => true, // This lets you ignore all nested firewalls
    });