MeiliSearch/meilisearch-http/tests
bors[bot] 4862993482
Merge #2525
2525: Auth: Provide all document related permissions for action document.* r=Kerollmops a=janithpet

Added a `Action::DocumentsAll` identifier as [suggested](https://github.com/meilisearch/meilisearch/issues/2080#issuecomment-1022952486), along with the other necessary changes in `action.rs`. 

Inside `store.rs`, added an extra condition in `HeedAuthStore::put_api_key` to append all document related permissions if `key.actions.contains(&DocumentsAll)`.

Updated the tests as [suggested](https://github.com/meilisearch/meilisearch/issues/2080#issuecomment-1022952486).

I am quite new to Rust, so please let me know if I had made any mistakes; have I written the code in the most idiomatic/efficient way? I am aware that the way I append the document permissions could create duplicates in the `actions` vector, but I am not sure how fix that in a simple way (other than using other dependencies like [itertools](https://github.com/rust-itertools/itertools), for example).

## What does this PR do?
Fixes #2080 

## PR checklist
Please check if your PR fulfills the following requirements:
- [ ] Does this PR fix an existing issue?
- [ x] Have you read the contributing guidelines?
- [ x] Have you made sure that the title is accurate and descriptive of the changes?

Thank you so much for contributing to Meilisearch!


Co-authored-by: janithPet <jpetangoda@gmail.com>
2022-06-28 14:02:06 +00:00
..
assets Fix content of dump/assets for testing 2022-06-22 14:51:52 +02:00
auth Provide all document related permissions for action document.* 2022-06-15 16:11:39 +01:00
common Merge #2502 2022-06-13 10:11:22 +00:00
dashboard Add tests for mini-dashboard status and assets 2021-10-27 17:57:25 +05:30
documents Add a new meilisearch_types crate 2022-06-09 16:14:13 +02:00
dumps Merge #2502 2022-06-13 10:11:22 +00:00
index Add a new meilisearch_types crate 2022-06-09 16:14:13 +02:00
search Change the test for the new pagination.limited_to setting 2022-06-09 10:56:43 +02:00
settings Add a new meilisearch_types crate 2022-06-09 16:14:13 +02:00
snapshot feat(http): paginate the index resource 2022-05-31 18:11:45 +02:00
stats Rename the uid to taskUid in asynchronous response 2022-05-31 11:33:20 +02:00
tasks Fix a test that was depending on the speed of the CPU 2022-06-02 10:21:19 +02:00
content_type.rs Fix the authorization tests 2022-06-02 12:16:46 +02:00
integration.rs chore(dump): add tests 2022-05-24 14:21:56 +02:00