diff --git a/pillar/application/modules/projects.py b/pillar/application/modules/projects.py index 5acdab44..d259d5e3 100644 --- a/pillar/application/modules/projects.py +++ b/pillar/application/modules/projects.py @@ -388,7 +388,7 @@ def project_node_type_has_method(response): return abort(404) # Check permissions and append the allowed_methods to the node_type - check_permissions('project', response, 'GET', append_allowed_methods=True, + check_permissions('projects', response, 'GET', append_allowed_methods=True, check_node_type=node_type_name) diff --git a/tests/test_nodes.py b/tests/test_nodes.py index e0f085fb..9482f132 100644 --- a/tests/test_nodes.py +++ b/tests/test_nodes.py @@ -1,3 +1,5 @@ +import json + from bson import ObjectId from eve.methods.post import post_internal from eve.methods.put import put_internal @@ -68,3 +70,14 @@ class NodeContentTypeTest(AbstractPillarTest): perform_test(file_id_image, 'image') perform_test(file_id_video, 'video') perform_test(file_id_blend, 'file') + + def test_get_project_node_type(self): + user_id = self.create_user() + self.create_valid_auth_token(user_id, 'token') + project_id, _ = self.ensure_project_exists() + + resp = self.client.get('/projects/%s?node_type=asset' % project_id) + self.assertEqual(200, resp.status_code) + + data = json.loads(resp.data) + self.assertEqual([u'GET'], data['allowed_methods'])