You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@couchdb.apache.org by wh...@aol.com on 2010/08/24 09:02:26 UTC

change _security for db

How do you change the _security feature of the database.
Is _security considered a doc or a db?

How would you say add a name to the names list

like


{"admins":{"names":["joe2"],"roles":[]},"readers":{"names":["joe2"],"roles":[]}}

what couchjs feature would allow you to add a name to a list


Dan
Trying to get html to talk to couch through couchjs.

 
=

Re: change _security for db

Posted by Zachary Zolton <za...@gmail.com>.
Dan,

For each database there is a security object; t's not a document, nor
does it replicate like one.

The easiest way to change this object is to just open Futon, click on
your database and then click the "Security..." button near the top.
Note that the textboxes should contain JSON arrays of the names you
want.

If you need to add to security object programmatically then it goes
something like this:

security = http_get_json 'http://admin:pass@your.couch/dbname/_security'
# e.g. you wanna add user 'foobar' onto array of reader names:
security.readers.names.push 'foobar'
http_put_json 'http://admin:pass@your.couch/dbname/_security', security

For more information, see:
http://wiki.apache.org/couchdb/Security_Features_Overview#Authorization


Cheers,

Zach


On Tue, Aug 24, 2010 at 2:02 AM,  <wh...@aol.com> wrote:
> How do you change the _security feature of the database.
> Is _security considered a doc or a db?
>
> How would you say add a name to the names list
>
> like
>
>
> {"admins":{"names":["joe2"],"roles":[]},"readers":{"names":["joe2"],"roles":[]}}
>
> what couchjs feature would allow you to add a name to a list
>
>
> Dan
> Trying to get html to talk to couch through couchjs.
>
>
> =
>