-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Authorising Scope for non Active Record collections via Elastic Search #3173
Comments
Hey, thanks for the detailed writeup. I can think of two basic approaches:
I hope one of those helps! If you run into trouble, let me know which approach you tried and what code you used for it, and what issue or error you encountered when you tried it. |
Sorry for the delay in response and thanks for the detailed suggestions. I think we can go for Solution # 2 since scoping from the array side (Solution # 1) might leads to a mismatch in the count of records and the content we display on the page. |
Unable to scope records returning from Elastic Search since they are Non Active Record collections
I have a custom connection to fetch a collection and I'm using Elastic Search to retrieve that records. Since it's returning the collection in plain Array, it is not calling the designated Policy class and because of this, I'm unable to scope the collection.
Is there any workaround in which I can apply the scope for the collection which is Non AR? I'm using pundit for authorization link
eg:
Versions
graphql
version: 1.10.7rails
: 5.2.4graphql-pro
: 1.11.0Hope the code example is helpful
Thanks in Advance
The text was updated successfully, but these errors were encountered: