Commit 860576b8 authored by A. Koch's avatar A. Koch

set default owner acl entry on post

parent 06387bf6
......@@ -9,7 +9,7 @@ const setupACL = async function (app) {
cfg.logger = console
const client = new MongoDB(cfg, 'uuid')
await client.connect()
const acl = new Acl(new Backend(client.db, cfg.prefix))
const acl = new Acl(new Backend(client.db.s.db, cfg.prefix))
return acl
}
......
......@@ -45,6 +45,7 @@ class Service extends TinyEmitter {
const instance = new this.ModelConstructor(data),
result = await this.client.create(instance, req.params)
instance.populate(result)
acl.allow(req.user.uuid, `/${this._name}/${instance.uuid}`, '*')
_this._response(req, res, instance)
})
......
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