Hello nicolaiarocci,
First off, thank you and everyone who contributes to Eve; it looks like a fantastic project to really streamline creating rest api's in python.
But, in trying things out, I've run into a problem. After cloning the repository and starting the development server, I am unable to DELETE
single items. For example (with MongoDB setup in a docker container and pip3 install eve
in a virtualenv (python version 3.4)):
$ curl -X GET -H 'Content-Type: application/json' localhost:5000/people
{
"_items": [],
"_links": {
"parent": {
"title": "home",
"href": ""
},
"self": {
"title": "people",
"href": "/people"}
}
}
$ curl -X POST -d '{"firstname": "test", "lastname": "test", "role": ["contributor"]}' localhost:5000/people
{
"_updated": "Fri, 05 Sep 2014 18:01:44 GMT",
"_id": "5409fa883a347127db3e82c2",
"_created": "Fri, 05 Sep 2014 18:01:44 GMT",
"_links": {
"self": {
"title": "person",
"href": "/people/5409fa883a347127db3e82c2"
}
},
"_status": "OK",
"_etag": "54fa4ca775664d6f0e095aeba187cc3a6f14c78c"
}
$ curl -X DELETE localhost:5000/people/5409fa883a347127db3e82c2
{
"_error": {
"message": "You don't have the permission to access the requested resource. It is either read-protected or not readable by the server.",
"code": 403
},
"_status": "ERR"
}
$ # ^^^ This should have worked
$ curl -X PATCH -d '{"firstname": "test_changed"}' localhost:5000/people
{
"_error": {
"message": "You don't have the permission to access the requested resource. It is either read-protected or not readable by the server.",
"code": 403
},
"_status": "ERR"
}
$ # ^^^ This also does not work
$ curl -X DELETE localhost:5000/people
{}
$ # ^^^ But, this does work
I've logged into my MongoDB instance and checked that the person is actually being stored. And, I've tried adding all methods to PUBLIC_METHODS
and PUBLIC_ITEM_METHODS
and even to individual resources' resource_methods
, item_methods
, public_methods
, public_item_methods
methods lists.
I am having this same problem on my own testing of eve. So, assuming everything would be configured correctly in this repo, I thought I would clone the demo to check if it is just my settings that were misconfigured. But, it looks like the problem exists here as well. Is there something I've missed?