couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From payam yousefi <payam.youse...@gmail.com>
Subject Re: How to delete a user
Date Tue, 13 Jul 2010 13:07:23 GMT
Hey Dear I'm answering you for the second time
(MyFirstPost<http://mail-archives.apache.org/mod_mbox/couchdb-user/201007.mbox/browser>)
please check , if it's wrong tell me :

Hello Mickael
This exception come from _user database  'validate_doc_update' (located at
"_users/_design/_auth"), this validations check always call before
committing any change .

you get exception at this part of validations check :*
if ((oldDoc || newDoc).type != 'user') {
             throw({forbidden : 'doc.type must be user'});
}*
maybe you just need to set "type : user  " in your user document before try
to remove.

Regards,
Payam.

On Tue, Jul 13, 2010 at 3:02 PM, <mickael.bailly@free.fr> wrote:

> My bad, the PUT trick does not work... I made a typo error ( using deleted
> instead of _deleted)...
>
> There seems to be no way of deleting a user...
>
> ----- Mail Original -----
> De: "mickael bailly" <mickael.bailly@free.fr>
> À: user@couchdb.apache.org
> Envoyé: Mardi 13 Juillet 2010 10h24:47 GMT +01:00 Amsterdam / Berlin /
> Berne / Rome / Stockholm / Vienne
> Objet: Re: How to delete a user
>
> Hello,
>
> the GET part :
>
> $ curl --proxy "" -X GET http://adm:sometest@localhost
> :5984/_users/org.couchdb.user:joe
>
> {"_id":"org.couchdb.user:joe","_rev":"1-3aa8c71e227226e1363a759839a572d8","salt":"ab20f6a8e2cf91be6ce319d86be07a2a0207d7a1","password_sha":"d2fe4ed55fa1ef70b62b737d88890b38e5818106","name":"joe","type":"user","roles":[]}
>
> the DELETE part :
>
> curl --proxy "" -X DELETE "http://adm:sometest@localhost
> :5984/_users/org.couchdb.user:joe?rev=1-3aa8c71e227226e1363a759839a572d8"
> {"error":"forbidden","reason":"doc.type must be user"}
>
> However, like J Chris suggest it, if I use a PUT request, adding the
> {"_deleted": true} property, it works.
>
> Sad but true.
>
> Mickael
>
> ----- Mail Original -----
> De: "Benoit Chesneau" <bchesneau@gmail.com>
> À: user@couchdb.apache.org
> Envoyé: Mardi 13 Juillet 2010 09h06:59 GMT +01:00 Amsterdam / Berlin /
> Berne / Rome / Stockholm / Vienne
> Objet: Re: How to delete a user
>
> On Mon, Jul 12, 2010 at 1:36 PM,  <mickael.bailly@free.fr> wrote:
> > Hello Couchers,
> >
> > I'm playing with CouchDB Security features, but can't get a user removal
> script to work.
> > I try to fetch the user object, from the _users database, and then issue
> a DELETE REST query (of course, including the revision).
> >
> > It does not work, and returns an error "doc.type must be user". I went
> through the wiki but did not find how to delete a user.
> >
> > Anyone can help me ?
> >
> > Regards,
> >
> > Mickael
> >
> >
> >
>
> What are your GET and DELETE call ?
>
> - benoît
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message