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