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

Support for Blacklight 7 #56

Open
awead opened this issue May 15, 2019 · 5 comments
Open

Support for Blacklight 7 #56

awead opened this issue May 15, 2019 · 5 comments

Comments

@awead
Copy link
Contributor

awead commented May 15, 2019

Does BL-AC support BL 7? From what I can tell, it's being testing, but adding to an existing app doesn't seem to quite work. This still needs to be done:

https://github.com/projectblacklight/blacklight-access_controls/blob/master/lib/blacklight/access_controls/catalog.rb#L19

I might have some time to dedicate to this if anyone can give a status update in terms of what needs to be done, and suggestions as to how to solve those. Do we need separate generators for the different versions?

@jcoyne
Copy link
Member

jcoyne commented May 16, 2019

Alternatively, you could do something like: Blacklight::SearchService.search_builder_class = Blacklight::AccessControls::SearchBuilder, but I think I prefer BAC to provide it's own SearchService.

e.g.:

class Blacklight::AccessControls::SearchService < Blacklight::SearchService
...
end

CatalogController.search_service_class = Blacklight::AccessControls::SearchService 

@jrochkind
Copy link
Member

jrochkind commented May 21, 2019

If you have a fixed SearchService class you use like:

CatalogController.search_service_class = Blacklight::AccessControls::SearchService 

Then the Blacklight::AccessControls SearchService customization is the only one you can easily have in your app. What if you need other ones too? (I have done a local one myself)

So recommend maybe additionally providing an AS::Concern you can mix into your own local SearchService class to get blacklight-access_controls behavior, which can be in addition to other search service customizations, local or from other gems?

CatalogController.search_service_class = MySearchService 

class MySearchService < Blacklight::SearchService
   include Blacklight::AccessControls::SearchServiceBehavior
   include Whatever::SomethingElse
end

I can't think of any other way to allow search service customizations from both b-ac and maybe other places?

Possibly useful things I discovered for context:

https://bibwild.wordpress.com/2019/04/30/blacklight-7-current_user-or-other-request-context-in-searchbuilder-solr-query-builder/

@dgcliff
Copy link
Contributor

dgcliff commented May 21, 2019

That seems a reasonable approach to take with a generator

@awead
Copy link
Contributor Author

awead commented May 21, 2019

Incidentally, these were the only changes I had to make to get this working in BL7:

psu-libraries/cho@331b95f#diff-a3a81055b647b2fd690ac3b4d2939899R239
psu-libraries/cho@331b95f#diff-a3a81055b647b2fd690ac3b4d2939899R239

Enforcing restrictions on show actions works as-is.

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

No branches or pull requests

4 participants