Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

global: adds permissions #34

Merged
merged 1 commit into from
Mar 9, 2016
Merged

global: adds permissions #34

merged 1 commit into from
Mar 9, 2016

Conversation

krzysztof
Copy link
Member

  • Adds permissions to files REST.

@@ -138,7 +138,7 @@ def test_post_bucket(app, dummy_location):
# def test_get_object_list(app, dummy_objects):


def test_get_object_get(app, objects):
def TODO_test_get_object_get(app, objects):
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unfortunately @ddaze we did double work as I also implemented some views tests (which also take permissions into account). I have the test test_get_object_get and test_get_object_get_404 temporarily. I will have to merge those views together, so the invenio_files_rest/test_permissions.py file will disappear on behalf of the views tests which will live here instead.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Update: Merged tests from test_permissions.py into test_views.py

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No problem, I learned how it works by implementing it.

* Adds permissions to files REST

Signed-off-by: Krzysztof Nowak <k.nowak@cern.ch>
client.post(login_url, data=u2_data)
data = {'file': (BytesIO(b'contents2'), 'file.dat')}
resp = client.put(object_url, data=data, headers=headers)
assert resp.status_code == 403
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This test should be extended to test for valid PUT (i.e. assert resp.status_code == 200 and check if file is correct), but that's blocked by serialization feature: https://github.com/inveniosoftware/invenio-files-rest/blob/master/invenio_files_rest/views.py#L519

@krzysztof krzysztof changed the title global: WIP adds permissions global: adds permissions Mar 8, 2016
@lnielsen lnielsen merged commit b0807c0 into inveniosoftware:master Mar 9, 2016
@krzysztof krzysztof deleted the permissions branch November 28, 2016 10:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants