Put a doc via a WRITE-ONLY user on a Cloudant db?

75 views
Skip to first unread message

Sinan Gabel

unread,
Sep 16, 2015, 5:00:27 AM9/16/15
to PouchDB
Hi!

Using PouchDB in browser, is there a way to Put a doc via a WRITE-ONLY user on a Cloudant db?


Br,
Sinan

Nolan Lawson

unread,
Oct 2, 2015, 1:19:33 PM10/2/15
to PouchDB
What do you mean by a write-only user? My understanding is that any user that can write can also read.

Sinan Gabel

unread,
Oct 2, 2015, 2:16:24 PM10/2/15
to pou...@googlegroups.com
Hi

On Cloudant - for a given username:password - you can set security on four elements individually: READ and/or WRITE and/or REPLICATE and/or ADMIN. 

So I mean a database where the given username:password can only WRITE to.

With CURL, for example, a standard PUT or POST does it.


Br,
Sinan

--
You received this message because you are subscribed to a topic in the Google Groups "PouchDB" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/pouchdb/VpE4Z0sY8dA/unsubscribe.
To unsubscribe from this group and all its topics, send an email to pouchdb+u...@googlegroups.com.
To post to this group, send email to pou...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/pouchdb/d49e8d10-6b37-44aa-8f34-bd840bee5744%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

Nolan Lawson

unread,
Oct 8, 2015, 11:10:59 AM10/8/15
to PouchDB
Hm. if you can PUT or POST to a remote database, then a db.put() should work fine.

Sinan Gabel

unread,
Oct 8, 2015, 12:20:47 PM10/8/15
to pou...@googlegroups.com
testdb.put({"a": 100})

returns

{status: 403, name: "forbidden", message: "Forbidden by design doc validate_doc_update function", error: true, reason: "_reader access is required for this request"}

On 8 October 2015 at 17:10, Nolan Lawson <no...@nolanlawson.com> wrote:
Hm. if you can PUT or POST to a remote database, then a db.put() should work fine.

--
You received this message because you are subscribed to a topic in the Google Groups "PouchDB" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/pouchdb/VpE4Z0sY8dA/unsubscribe.
To unsubscribe from this group and all its topics, send an email to pouchdb+u...@googlegroups.com.
To post to this group, send email to pou...@googlegroups.com.

Nolan Lawson

unread,
Oct 9, 2015, 12:29:38 PM10/9/15
to PouchDB
Ah okay, looks like you have a  design doc with a validate_doc_update that is not allowing your PUTs? As an admin, you should be able to change that design doc to have whatever validation logic you want.

Surya Teja

unread,
Aug 9, 2016, 10:03:20 PM8/9/16
to PouchDB

Hello sinan,

I am also facing same issue, Did u resolved  it?  can u tell me how to resolve it
Reply all
Reply to author
Forward
0 new messages