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

Hyrax::AdministrativeSets fail to be listed on Dashboard->Collections #5408

Closed
elrayle opened this issue Jan 28, 2022 · 2 comments · Fixed by #5423
Closed

Hyrax::AdministrativeSets fail to be listed on Dashboard->Collections #5408

elrayle opened this issue Jan 28, 2022 · 2 comments · Fixed by #5423

Comments

@elrayle
Copy link
Contributor

elrayle commented Jan 28, 2022

Descriptive summary

Dashboard -> Collections correctly lists Hyrax::PcdmCollections, but fails to list Hyrax::AdministrativeSets. Investigation as part of Issue #5334 determined that the AdministrativeSet is created as expected. It is just failing to be listed.

Rationale

All collections and admin sets should be listed for Dashboard -> Collections regardless of the model used to create them.

Expected behavior

After creating a Hyrax::AdministrativeSet, it should be listed in Dashboard -> Collections.

Actual behavior

After creating a Hyrax::AdministrativeSet, it is NOT listed in Dashboard -> Collections.

Steps to reproduce the behavior

Prerequisites:

Configure Hyrax:

  1. Edit /config/initializers/hyrax.rb and set:
  config.query_index_from_valkyrie = true
  config.index_adapter = :solr_index
  config.admin_set_model = "Hyrax::AdministrativeSet"
  1. restart rails app

To reproduce:

Create Admin Set

  1. navigate to Dashboard -> Collections
  2. click button: New Collection
  3. select type: Admin Set
  4. click button: Create collection
  5. set Title: MY ADMIN SET (or other meaningful name)
  6. click Save
  7. navigate to Dashboard -> Collections

The new admin set should be in the list of collections, but it is not.

Related work

See related issues in Issue #5326 UBER: Hyrax-Valkyrization MVP
See Issue #5334 for an investigation of this issue

@elrayle
Copy link
Contributor Author

elrayle commented Jan 28, 2022

The Hyrax::AdministrativeSet was not one of the classes for the search builder. But adding it didn't resolve the issue. Looking at the Solr docs in the hyrax-dev and nurax-pg cores shows different structures to the documents. So this may be an indexing problem.

Example, hyrax-dev solr doc

{
        "id":"gx41mh844",
        "system_create_dtsi":"2022-01-24T14:22:18Z",
        "system_modified_dtsi":"2022-01-24T14:22:18Z",
        "has_model_ssim":["AdminSet"],
        "creator_ssim":["*******"],
        "title_tesim":["MY ADMINSET"],
        "description_tesim":[""],
*       "edit_access_group_ssim":["admin"],
*       "edit_access_person_ssim":["*******"],
*       "human_readable_type_tesim":["Admin Set"],
*       "accessControl_ssim":["8533ca54-3d8c-4552-be71-10a911dded0a"],
*       "thumbnail_path_ss":"/assets/collection-a38b932554788aa578debf2319e8c4ba8a7db06b3ba57ecda1391a548a4b6e0a.png",
        "_version_":1722846165225963520,
        "timestamp":"2022-01-24T14:22:18.895Z",
        "score":1.0},

nurax-pg solr doc

{
        "id":"e4db45b0-541e-4fca-b32f-06bd03959493",
        "date_uploaded_dtsi":"2022-01-28T11:53:14Z",
        "date_modified_dtsi":"2022-01-28T11:53:14Z",
        "has_model_ssim":["Hyrax::AdministrativeSet"],
        "creator_ssim":["********"],
        "title_tesim":["AM I IN SOLR"],
        "description_tesim":["am I created in solr and the datastore as expected?"],
        "_version_":1723199174454804480,
        "timestamp":"2022-01-28T11:53:14.729Z",
        "score":1.0},

Lines with * appear in the hyrax-dev core but not nurax-pg core. Could be as simple as including permissions indexing.

@elrayle
Copy link
Contributor Author

elrayle commented Jan 28, 2022

PR #5421 Address several of the causes of this issue. It does not fully fix this issue.

The known causes preventing admin sets from being listed on Dashboard -> Collections are:

  • 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 PR #5421. 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"}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Hyrax-Valkyrization
Ready to be Archived
Development

Successfully merging a pull request may close this issue.

1 participant