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

queryparser: add RestrictedTerm to exclude allowed phrases by permission #599

Merged
merged 1 commit into from
Nov 8, 2024

Conversation

kpsherva
Copy link
Contributor

@kpsherva kpsherva commented Nov 1, 2024

@kpsherva kpsherva changed the title queryparser: hide internal notes from non admin search queryparser: add RestrictedTerm to exclude allowed phrases by permission Nov 1, 2024
@@ -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)
Copy link
Member

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.

@kpsherva kpsherva force-pushed the internal_notes branch 3 times, most recently from 463b158 to fc1c63b Compare November 7, 2024 10:10
term_name = node.name
if isinstance(term_name, RestrictedTerm):
allows = term_name.allows(context["identity"])
term_name = node.name
Copy link
Contributor

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?

@zzacharo zzacharo merged commit 4a0d858 into inveniosoftware:master Nov 8, 2024
2 checks passed
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.

fields: add internal notes
3 participants