-
Notifications
You must be signed in to change notification settings - Fork 143
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
11708 handle list of search results for permission_backend.get_search_ui_permissions
#11709
base: dev/7.6.x
Are you sure you want to change the base?
Conversation
permission_backend.get_search_ui_permissions
@@ -142,6 +142,9 @@ def get_permission_search_filter(self, user): ... | |||
@abstractmethod | |||
def get_search_ui_permissions(self, user, search_result, groups=None): ... | |||
|
|||
@abstractmethod |
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.
Hey Galen. I haven't looked too closely yet, but can you share why would we need a separate method if the signature is the same as get_search_ui_permissions
?
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.
I actually ended up just updating the original logic of the get_search_ui_permissions
method to handle either a dict
or a list
of search results and return back the like. I wanted to ensure this wouldn't be a breaking change.
While I think it would be really great to have this performance improvement 7.6, I feel that it is just too significant a change to go in a patch release. I think it should instead target the 8.0 release. |
Types of changes
Description of Change
This PR addresses the fact that an ORM query gets called for each individual search result whenever
get_search_ui_permissions
gets called. None of the actual logic has been altered, however now the method accepts either a single search_resultdict
or alist
of them, returning the same type of thing as it received. This means the ORM query to lookup nodegroup permissions now happens once for a set of results, significantly speeding up performance on larger sets of search_results. The Search Results filter has been updated to send/receive a list.Issues Solved
Closes #11708
Checklist
Accessibility Checklist
Developer Guide
Ticket Background
Further comments