Skip to content
This repository was archived by the owner on Nov 27, 2023. It is now read-only.

Commit b2d3e1e

Browse files
authored
Error on unsupported access controller operations
Provide feedback when access controller does not support operation via http 501 error. Fixes #20
1 parent 870eb91 commit b2d3e1e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/lib/orbitdb-api.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -265,8 +265,8 @@ class OrbitdbAPI {
265265
method: ['POST', 'PUT'],
266266
path: '/db/{dbname}/access/write',
267267
handler: dbMiddleware( async (db, request, _h) => {
268-
await db.access.grant('write', request.payload.id)
269-
return {};
268+
await db.access.grant('write', request.payload.id) &&
269+
return {} || return new Boom.notImplemented('Access controller does not support setting write access');
270270
})
271271
},
272272
{

0 commit comments

Comments
 (0)