Commit 4e324bc1 authored by anton's avatar anton
Browse files

Ad acl service stub

parent a3fbdafd
Pipeline #164524 passed with stage
in 53 seconds
/* eslint-disable no-unused-vars */
exports.Acl = class Acl {
constructor (options) {
this.options = options || {}
}
async find (params) {
return []
}
async get (id, params) {
return {
id, text: `A new message with ID: ${id}!`
}
}
async create (data, params) {
if (Array.isArray(data)) {
return Promise.all(data.map(current => this.create(current, params)))
}
return data
}
async update (id, data, params) {
return data
}
async patch (id, data, params) {
return data
}
async remove (id, params) {
return { id }
}
}
const { authenticate } = require('@feathersjs/authentication').hooks
module.exports = {
before: {
all: [authenticate('jwt')],
find: [],
get: [],
create: [],
update: [],
patch: [],
remove: []
},
after: {
all: [],
find: [],
get: [],
create: [],
update: [],
patch: [],
remove: []
},
error: {
all: [],
find: [],
get: [],
create: [],
update: [],
patch: [],
remove: []
}
}
// Initializes the `acl` service on path `/acl`
const { Acl } = require('./acl.class')
const hooks = require('./acl.hooks')
module.exports = function (app) {
const options = {
paginate: app.get('paginate')
}
// Initialize our service with any options it requires
app.use('/acl', new Acl(options, app))
// Get our initialized service so that we can register hooks
const service = app.service('acl')
service.hooks(hooks)
}
const annotations = require('./annotations/annotations.service.js')
const maps = require('./maps/maps.service.js')
const users = require('./users/users.service.js')
const acl = require('./acl/acl.service.js')
// eslint-disable-next-line no-unused-vars
module.exports = function (app) {
app.configure(users)
app.configure(annotations)
app.configure(maps)
app.configure(acl)
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment