403 forbidden creating views

Dear forum
I want to create a view using
curl -H ‘Content-Type: application/json’ -vX PUT ‘http://public ip:4985/mydb/_design/users’
-d ‘{“views”: {“all”: {“map”: “function(doc, meta) {if (doc.type == “user”) {emit(doc.name, null);}}”}}}’

but i get 403 forbidden response.
My gateway conf json file is:
“log”: [""],
“databases”: {
“db”: {
“unsupported”: {
“user_views”: {
“server”: “http://localhost:8091/”,
“bucket”: “default”,
“users”: { “GUEST”: { “disabled”: false, “admin_channels”: ["
"] } }

What wrong with this?

admin port is only addressable on sync gateway server default. can you try this command

curl -H 'Content-Type: application/json' -vX PUT 'http://localhost:4985/mydb/_design/users' \
-d '{"views": {"all": {"map": "function(doc, meta) {if (doc.type == \"user\") {emit(doc.name, null);}}"}}}'

on sync gateway server local?

Can you run curl -v and post the detailed error if there is one? Or, check the sync gateway logs and see if there are any more detailed error messages?

It could be a quoting issue.

I think curl has a way to read the input from a file rather than directly on the command line, which might rule out certain quoting issues.

Also, you might want to try t “-v -X” rather than “-vX”