How to use the baucis.Error function in baucis

To help you get started, we’ve selected a few baucis examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github capaj / Moonridge / utils / baucis.js View on Github external
request.baucis.incoming(function (ctx, cb) {
      const doc = ctx.doc
      let errWhileCheckingPermissions
      try {
        mrOpts.checkPermission(request, mapVerbToOperation[request.method], doc)
      } catch (err) {
        errWhileCheckingPermissions = err
      }
      if (errWhileCheckingPermissions === undefined) {
        return cb(null, ctx)
      } else {
        return response.status(403).send(baucis.Error.Forbidden(`You lack a privilege to ${request.method} ${model.modelName} collection`))
      }
    })
    request.baucis.outgoing(function (ctx, cb) {

baucis

Build scalable REST APIs using the open source tools and standards you already know.

MIT
Latest version published 2 months ago

Package Health Score

60 / 100
Full package analysis