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

Fixing issues where Hyrax::FileSet resources are incorrectly cast to AF ::FileSet #7038

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

randalldfloyd
Copy link
Contributor

Fixes #7001

In the dassie test app, the value of Hyrax.config.file is set to be ::FileSet. This unintentionally causes all FileSets to be force-cast back to a ActiveFedora FileSet in the FileSetsController, even if they should be a Valkyrie Hyrax::FileSet resource. That's because the class name passed to load_and_authorize_resource uses that config value.

The value of Hyrax.config.file needs to be left at ::FileSet for AF models to work, so this PR adds a conditional check in a before_action to see if it should cast a FileSet back with .valkyrie_resource. Otherwise, nothing in the FileSetsController will work (i.e. versions, etc.)

Copy link

github-actions bot commented Mar 5, 2025

Test Results

    13 files  ±0      13 suites  ±0   2h 48m 23s ⏱️ - 19m 38s
 6 833 tests ±0   6 532 ✅ +5  299 💤 ±0  2 ❌  - 5 
18 102 runs  ±0  17 623 ✅ +5  477 💤 ±0  2 ❌  - 5 

For more details on these failures, see this check.

Results for commit 8d2dc58. ± Comparison against base commit cf3f95e.

This pull request removes 366 and adds 366 tests. Note that renamed tests count towards both.
spec.abilities.ability_spec ‑ Hyrax::Ability AdminSets and PermissionTemplates a user without edit access is expected not to be able to create #<Hyrax::PermissionTemplate:0x00007efc0d2edac8>
spec.abilities.ability_spec ‑ Hyrax::Ability AdminSets and PermissionTemplates a user without edit access is expected not to be able to create #<Hyrax::PermissionTemplate:0x00007f01ff8f3ad8>
spec.abilities.ability_spec ‑ Hyrax::Ability AdminSets and PermissionTemplates a user without edit access is expected not to be able to create #<Hyrax::PermissionTemplate:0x00007f44eb3976c8>
spec.abilities.ability_spec ‑ Hyrax::Ability AdminSets and PermissionTemplates a user without edit access is expected not to be able to create #<Hyrax::PermissionTemplateAccess:0x00007efc10408c20>
spec.abilities.ability_spec ‑ Hyrax::Ability AdminSets and PermissionTemplates a user without edit access is expected not to be able to create #<Hyrax::PermissionTemplateAccess:0x00007f01ffbb7bc0>
spec.abilities.ability_spec ‑ Hyrax::Ability AdminSets and PermissionTemplates a user without edit access is expected not to be able to create #<Hyrax::PermissionTemplateAccess:0x00007f44e86c9c40>
spec.abilities.ability_spec ‑ Hyrax::Ability AdminSets and PermissionTemplates a user without edit access is expected not to be able to destroy AdminSet: 01e190bf-cbfa-410a-ab6a-6ed68a131b37
spec.abilities.ability_spec ‑ Hyrax::Ability AdminSets and PermissionTemplates a user without edit access is expected not to be able to destroy Hyrax::AdministrativeSet: 1df5fbf9-294b-43e8-bfe1-4a2d8576211c
spec.abilities.ability_spec ‑ Hyrax::Ability AdminSets and PermissionTemplates a user without edit access is expected not to be able to destroy Hyrax::AdministrativeSet: 871d87c2-2b73-4b70-b3ad-8b2f67dbdfd1
spec.abilities.ability_spec ‑ Hyrax::Ability AdminSets and PermissionTemplates a user without edit access is expected not to be able to edit AdminSet: 6082da9f-d13f-418a-964f-4e766fdc4c75
…
spec.abilities.ability_spec ‑ Hyrax::Ability AdminSets and PermissionTemplates a user without edit access is expected not to be able to create #<Hyrax::PermissionTemplate:0x00007f24642dc320>
spec.abilities.ability_spec ‑ Hyrax::Ability AdminSets and PermissionTemplates a user without edit access is expected not to be able to create #<Hyrax::PermissionTemplate:0x00007f546f5b07a0>
spec.abilities.ability_spec ‑ Hyrax::Ability AdminSets and PermissionTemplates a user without edit access is expected not to be able to create #<Hyrax::PermissionTemplate:0x00007fddaaa3d718>
spec.abilities.ability_spec ‑ Hyrax::Ability AdminSets and PermissionTemplates a user without edit access is expected not to be able to create #<Hyrax::PermissionTemplateAccess:0x00007f24642b0dd8>
spec.abilities.ability_spec ‑ Hyrax::Ability AdminSets and PermissionTemplates a user without edit access is expected not to be able to create #<Hyrax::PermissionTemplateAccess:0x00007f546f52f010>
spec.abilities.ability_spec ‑ Hyrax::Ability AdminSets and PermissionTemplates a user without edit access is expected not to be able to create #<Hyrax::PermissionTemplateAccess:0x00007fddae3e2310>
spec.abilities.ability_spec ‑ Hyrax::Ability AdminSets and PermissionTemplates a user without edit access is expected not to be able to destroy AdminSet: e07af38a-c094-480e-949e-37533f71a5a1
spec.abilities.ability_spec ‑ Hyrax::Ability AdminSets and PermissionTemplates a user without edit access is expected not to be able to destroy Hyrax::AdministrativeSet: 3cdaecd8-1863-4c9c-ade8-9d5e0b1c92e9
spec.abilities.ability_spec ‑ Hyrax::Ability AdminSets and PermissionTemplates a user without edit access is expected not to be able to destroy Hyrax::AdministrativeSet: b595eefd-74db-4b30-af6d-93f8a9396beb
spec.abilities.ability_spec ‑ Hyrax::Ability AdminSets and PermissionTemplates a user without edit access is expected not to be able to edit AdminSet: cba7c7d0-de9d-4177-941e-8fd8b6a1a64a
…

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.

In latest Dassie (Ruby 3.3, Rails 7.2), fileset versions cannot be accessed or changed
1 participant