Crud with mongoDb-native and RBAC role/permission for AWS Lambdas
npm install @palmabit/lambda-mongo-crud --save
const Crud = require('@palmabit/lambda-mongo-crud')
const roles = {
base: {
can: ['posts:list','posts:get']
},
admin: {
can: ['posts:save','posts:delete']
}
}
const crud = new Crud('stringConnection','tableName','admin',roles)
const query = {}
const roleOptions = {}
crud.list(query,'posts:list',roleOptions, (err,docs) => {} )
npm test
npm run-script test-travis