This repository was archived by the owner on Nov 27, 2023. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +14
-1
lines changed Expand file tree Collapse file tree 2 files changed +14
-1
lines changed Original file line number Diff line number Diff line change 2626 - [ POST|PUT /db/: dbname /put] ( #post-put-dbdbnameput )
2727 - [ POST|PUT /db/: dbname /inc] ( #post-put-dbdbnameinc )
2828 - [ POST|PUT /db/: dbname /inc/: val ] ( #post-put-dbdbnameincval )
29+ - [ POST|PUT /db/: dbname /access/write] ( #post-put-dbdbnameaccesswrite )
2930 - [ DELETE /db/: dbname ] ( #delete-dbdbname )
3031 - [ DELETE /db/: dbname /: item ] ( #delete-dbdbnameitem )
3132- [ Contribute] ( #contribute )
@@ -400,6 +401,18 @@ curl -X POST http://localhost:3000/db/counter/inc/100
400401zdpuAmHw9Tcc4pyVjcVX3rJNJ7SGffmu4EwjodzmaPBVGGzbd
401402```
402403
404+ ### POST|PUT /db/: dbname /access/write
405+
406+ Adds the id to the list of peers who have write access to the : dbname data store.
407+
408+ ``` shell
409+ curl -X POST http://localhost:3000/db/docstore/access/write -d ' id=045757bffcc7a4...'
410+ ```
411+
412+ ``` json
413+ zdpuAmHw9Tcc4pyVjcVX3rJNJ7SGffmu4EwjodzmaPBVGGzbd
414+ ```
415+
403416### DELETE /db/: dbname
404417
405418Deletes the local database : dbname . This does not delete any data from peers.
Original file line number Diff line number Diff line change @@ -263,7 +263,7 @@ class OrbitdbAPI {
263263 method : [ 'POST' , 'PUT' ] ,
264264 path : '/db/{dbname}/access/write' ,
265265 handler : dbMiddleware ( async ( db , request , _h ) => {
266- await db . access . grant ( 'write' , request . payload . publicKey )
266+ await db . access . grant ( 'write' , request . payload . id )
267267 return { } ;
268268 } )
269269 } ,
You can’t perform that action at this time.
0 commit comments