Rework how supersearch fields permissions are handled #6764
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
In PR #6741, we're moving the code where we convert between the processed crash schema permissions in super search fields to webapp permissions to the general Socorro code. We try really hard to not have webapp things leak into the general Socorro code, so I wanted to experiment with other ways of solving the problem of having two elasticsearch crash storage implementations in respects to super search fields.
This tests that out by adding a
get_supersearch_fields()
function towebapp/crashstats/supersearch/libsupersearch.py
which imports the specified Elasticsearch crashstorage, getsSUPERSEARCH_FIELDS
from it, converts the permissions and returns it.While doing that, I fixed some clarity issues in the code.
convert_permissions
will never have a case where the field has permissions["public", "protected"]
--that's nonsensical so we shouldn't test that. Also,convert_permissions
shouldn't stomp on thepermissions_needed
value. Instead, it should put the webapp permissions in a new key and then webapp code should look there.