5.17. PUT /db/_security

MethodPUT /db/_security
Request JSON specifying the admin and user security for the database
Response JSON status message
Admin Privileges Requiredno

Sets the security object for the given database.For example, to set the security object for the recipes database:

PUT http://couchdb:5984/recipes/_security
Content-Type: application/json

{
   "admins" : {
      "roles" : [],
      "names" : [
         "mc",
         "slp"
      ]
   },
   "readers" : {
      "roles" : [],
      "names" : [
         "tim",
         "brian"
      ]
   }
}

If the setting was successful, a JSON status object will be returned:

{
   "ok" : true
}