-
Notifications
You must be signed in to change notification settings - Fork 49
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
queryparser: add RestrictedTerm to exclude allowed phrases by permission #599
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Contributor
kpsherva
commented
Nov 1, 2024
•
edited
Loading
edited
- closes fields: add internal notes CERNDocumentServer/cds-rdm#240
kpsherva
changed the title
queryparser: hide internal notes from non admin search
queryparser: add RestrictedTerm to exclude allowed phrases by permission
Nov 1, 2024
kpsherva
commented
Nov 1, 2024
invenio_records_resources/services/records/queryparser/transformer.py
Outdated
Show resolved
Hide resolved
kpsherva
commented
Nov 1, 2024
kpsherva
commented
Nov 1, 2024
kpsherva
force-pushed
the
internal_notes
branch
from
November 1, 2024 13:56
06b8f72
to
cb03a5f
Compare
zzacharo
reviewed
Nov 5, 2024
invenio_records_resources/services/records/queryparser/transformer.py
Outdated
Show resolved
Hide resolved
@@ -79,9 +129,9 @@ def visit_search_field(self, node, context): | |||
def visit_word(self, node, context): | |||
"""Visit a word term.""" | |||
mapper = context.get("field_value_mapper") | |||
yield node if mapper is None else mapper.map_word(node) | |||
yield node if mapper is None else mapper.map_word(node, context=context) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
that is a breaking change I think...see my comment above.
zzacharo
approved these changes
Nov 6, 2024
ntarocco
reviewed
Nov 6, 2024
invenio_records_resources/services/records/queryparser/transformer.py
Outdated
Show resolved
Hide resolved
invenio_records_resources/services/records/queryparser/transformer.py
Outdated
Show resolved
Hide resolved
invenio_records_resources/services/records/queryparser/transformer.py
Outdated
Show resolved
Hide resolved
invenio_records_resources/services/records/queryparser/transformer.py
Outdated
Show resolved
Hide resolved
invenio_records_resources/services/records/queryparser/transformer.py
Outdated
Show resolved
Hide resolved
kpsherva
force-pushed
the
internal_notes
branch
3 times, most recently
from
November 7, 2024 10:10
463b158
to
fc1c63b
Compare
ntarocco
reviewed
Nov 8, 2024
term_name = node.name | ||
if isinstance(term_name, RestrictedTerm): | ||
allows = term_name.allows(context["identity"]) | ||
term_name = node.name |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing field_value_mapper
assignment? move both after the if/raise?
ntarocco
approved these changes
Nov 8, 2024
kpsherva
force-pushed
the
internal_notes
branch
from
November 8, 2024 13:37
fc1c63b
to
a466af5
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.