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

set and index permissions for admin sets #5421

Merged
merged 2 commits into from
Jan 29, 2022
Merged

Conversation

elrayle
Copy link
Contributor

@elrayle elrayle commented Jan 28, 2022

Partially Addresses #5408

There are several issue preventing admin sets from being listed on Dashboard -> Collections.

  • the valkyrie_create method in the controller did not pass the user to the transaction creating permissions
  • the indexer didn't index permissions
  • the search builder didn't include Hyrax::AdministrativeSet in the list of models (selects all of the model set)
  • the search builder didn't include Hyrax::AdministrativeSet in the permissions limiter (filters out all without valid permissions)

The first 3 are fixed in this PR. The last part of the search build issue is not complete. See Remaining Work below.


Remaining Work

There is still an outstanding issue with the query to retrieve collections and admin sets.

Old Query:

{"qt"=>"search", "facet.field"=>["visibility_ssi", "suppressed_bsi", "resource_type_sim", "has_model_ssim"], "facet.query"=>[], "facet.pivot"=>["has_model_ssim,collection_type_gid_ssim"], "fq"=>["", "{!terms f=has_model_ssim}AdminSet,Hyrax::AdministrativeSet,Hyrax::PcdmCollection", "-suppressed_bsi:true", "(_query_:\"{!raw f=depositor_ssim}****@hotmail.com\" OR (_query_:\"{!raw f=has_model_ssim}AdminSet\" AND _query_:\"{!raw f=creator_ssim}****@hotmail.com\"))"], "hl.fl"=>[], "rows"=>10, "qf"=>"title_tesim description_tesim creator_tesim keyword_tesim", "facet"=>true, "f.visibility_ssi.facet.limit"=>6, "f.resource_type_sim.facet.limit"=>6, "f.collection_type_gid_ssim.facet.limit"=>6, "f.has_model_ssim.facet.limit"=>6, "sort"=>"title_si asc"}

This includes adding the Hyrax::AdministrativeSet to the set of models "{!terms f=has_model_ssim}AdminSet,Hyrax::AdministrativeSet,Hyrax::PcdmCollection", but the part that limits admin sets to the current user being the creator does not include Hyrax::AdministrativeSet. I wasn't able to come to a syntax for the query that would allow the model for this part of the query to be AdminSet OR Hyrax::AdministrativeSet. (_query_:\"{!raw f=has_model_ssim}AdminSet\" AND _query_:\"{!raw f=creator_ssim}****@hotmail.com\")

Attempt at a New Query (doesn't work):

{"qt"=>"search", "facet.field"=>["visibility_ssi", "suppressed_bsi", "resource_type_sim", "has_model_ssim"], "facet.query"=>[], "facet.pivot"=>["has_model_ssim,collection_type_gid_ssim"], "fq"=>["", "{!terms f=has_model_ssim}AdminSet,Hyrax::AdministrativeSet,Hyrax::PcdmCollection", "-suppressed_bsi:true", "(_query_:\"{!raw f=depositor_ssim}****@hotmail.com\" OR (_query_:\"{!terms f=has_model_ssim}AdminSet,Hyrax::AdministrativeSet\" AND _query_:\"{!raw f=creator_ssim}****@hotmail.com\"))"], "hl.fl"=>[], "rows"=>10, "qf"=>"title_tesim description_tesim creator_tesim keyword_tesim", "facet"=>true, "f.visibility_ssi.facet.limit"=>6, "f.resource_type_sim.facet.limit"=>6, "f.collection_type_gid_ssim.facet.limit"=>6, "f.has_model_ssim.facet.limit"=>6, "sort"=>"title_si asc"}

@samvera/hyrax-code-reviewers

@elrayle elrayle marked this pull request as ready for review January 28, 2022 23:06
@elrayle elrayle changed the title Dashboard list adminsets set and index permissions for admin sets Jan 28, 2022
@no-reply
Copy link
Member

looks great!

@no-reply no-reply merged commit 0954b08 into main Jan 29, 2022
@no-reply no-reply deleted the dashboard_list_adminsets branch January 29, 2022 00:53
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.

None yet

2 participants