creating a new role

64 views
Skip to first unread message

Seung Chan Lim

unread,
Feb 10, 2015, 4:39:45 PM2/10/15
to mobile-c...@googlegroups.com
I'm trying to create a new role by making a request to the ADMIN interface, but failing.

I tried a POST request to localhost:4985/db/_role/ with body {"name": "newrole"} which got me a 405 method not allowed.
I tried a PUT request to localhost:4985/db/_role/ with body {"name": "newrole"} which got me a 405 method not allowed.
I tried a PUT request to localhost:4985/db/_role/newrole with body {"name": "newrole"} which got me a 405 method not allowed.
I tried a POST request to localhost:4985/db/_role/newrole with body {"name": "newrole"} which got me a 405 method not allowed.

What is the proper way to create a new role?

slim

Jens Alfke

unread,
Feb 10, 2015, 7:20:53 PM2/10/15
to mobile-c...@googlegroups.com

> On Feb 10, 2015, at 1:39 PM, Seung Chan Lim <djs...@gmail.com> wrote:
>
> I'm trying to create a new role by making a request to the ADMIN interface, but failing.

It works for me…

$ http POST :4985/db/_role/ name=newrole
HTTP/1.1 201 Created
Content-Length: 0
Content-Type: text/plain; charset=utf-8
Date: Wed, 11 Feb 2015 00:18:45 GMT
Server: Couchbase Sync Gateway/unofficial

PUT to /db/_role/newrole worked too.
What version of SG is this? Is there any middleware between you and the gateway?

—Jens

Brett Harrison

unread,
Feb 10, 2015, 8:10:08 PM2/10/15
to mobile-c...@googlegroups.com
Did you name your database "db" in the server config file? 
Reply all
Reply to author
Forward
0 new messages