Skip to content

Add validation to local controlled vocabulary#7423

Open
kirkkwang wants to merge 3 commits intomainfrom
add-local-controlled-vocabulary-validation
Open

Add validation to local controlled vocabulary#7423
kirkkwang wants to merge 3 commits intomainfrom
add-local-controlled-vocabulary-validation

Conversation

@kirkkwang
Copy link
Copy Markdown
Contributor

The only defense against bad data for controlled vocabulary fields exists in the frontend with the select options. This commit will introduce a validator for local controlled vocabulary terms by way of Questioning Authority lookups which would ensure that anything interacting directly with the backend would only be allowed to input valid terms.

@samvera/hyrax-code-reviewers

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Apr 30, 2026

Test Results

    17 files  ± 0      17 suites  ±0   3h 22m 3s ⏱️ - 7m 51s
 7 347 tests +11   7 041 ✅ +11  306 💤 ±0  0 ❌ ±0 
24 732 runs  +46  24 141 ✅ +46  591 💤 ±0  0 ❌ ±0 

Results for commit 0c91161. ± Comparison against base commit cae6920.

This pull request removes 436 and adds 447 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:0x00007efd87f90160>
spec.abilities.ability_spec ‑ Hyrax::Ability AdminSets and PermissionTemplates a user without edit access is expected not to be able to create #<Hyrax::PermissionTemplate:0x00007f43517afc88>
spec.abilities.ability_spec ‑ Hyrax::Ability AdminSets and PermissionTemplates a user without edit access is expected not to be able to create #<Hyrax::PermissionTemplate:0x00007f940c3e3d50>
spec.abilities.ability_spec ‑ Hyrax::Ability AdminSets and PermissionTemplates a user without edit access is expected not to be able to create #<Hyrax::PermissionTemplate:0x00007fb14017d498>
spec.abilities.ability_spec ‑ Hyrax::Ability AdminSets and PermissionTemplates a user without edit access is expected not to be able to create #<Hyrax::PermissionTemplateAccess:0x00007efd880cb2c8>
spec.abilities.ability_spec ‑ Hyrax::Ability AdminSets and PermissionTemplates a user without edit access is expected not to be able to create #<Hyrax::PermissionTemplateAccess:0x00007f43517bc1e0>
spec.abilities.ability_spec ‑ Hyrax::Ability AdminSets and PermissionTemplates a user without edit access is expected not to be able to create #<Hyrax::PermissionTemplateAccess:0x00007f940c403218>
spec.abilities.ability_spec ‑ Hyrax::Ability AdminSets and PermissionTemplates a user without edit access is expected not to be able to create #<Hyrax::PermissionTemplateAccess:0x00007fb14085e258>
spec.abilities.ability_spec ‑ Hyrax::Ability AdminSets and PermissionTemplates a user without edit access is expected not to be able to destroy AdminSet: 03bcd766-44a7-4c85-a114-cc0a95c5566b
spec.abilities.ability_spec ‑ Hyrax::Ability AdminSets and PermissionTemplates a user without edit access is expected not to be able to destroy Hyrax::AdministrativeSet: 7913a7b4-338a-4103-bd3e-5d961108ea33
…
spec.abilities.ability_spec ‑ Hyrax::Ability AdminSets and PermissionTemplates a user without edit access is expected not to be able to create #<Hyrax::PermissionTemplate:0x00007f2c2902fb50>
spec.abilities.ability_spec ‑ Hyrax::Ability AdminSets and PermissionTemplates a user without edit access is expected not to be able to create #<Hyrax::PermissionTemplate:0x00007f58d75c1b88>
spec.abilities.ability_spec ‑ Hyrax::Ability AdminSets and PermissionTemplates a user without edit access is expected not to be able to create #<Hyrax::PermissionTemplate:0x00007f8ef9e0a648>
spec.abilities.ability_spec ‑ Hyrax::Ability AdminSets and PermissionTemplates a user without edit access is expected not to be able to create #<Hyrax::PermissionTemplate:0x00007fbfc7820648>
spec.abilities.ability_spec ‑ Hyrax::Ability AdminSets and PermissionTemplates a user without edit access is expected not to be able to create #<Hyrax::PermissionTemplateAccess:0x00007f2c2903be00>
spec.abilities.ability_spec ‑ Hyrax::Ability AdminSets and PermissionTemplates a user without edit access is expected not to be able to create #<Hyrax::PermissionTemplateAccess:0x00007f58d7638fd0>
spec.abilities.ability_spec ‑ Hyrax::Ability AdminSets and PermissionTemplates a user without edit access is expected not to be able to create #<Hyrax::PermissionTemplateAccess:0x00007f8ef73efca0>
spec.abilities.ability_spec ‑ Hyrax::Ability AdminSets and PermissionTemplates a user without edit access is expected not to be able to create #<Hyrax::PermissionTemplateAccess:0x00007fbfc7840150>
spec.abilities.ability_spec ‑ Hyrax::Ability AdminSets and PermissionTemplates a user without edit access is expected not to be able to destroy AdminSet: 15b3be75-5ca5-4379-80e0-48696bafd8d7
spec.abilities.ability_spec ‑ Hyrax::Ability AdminSets and PermissionTemplates a user without edit access is expected not to be able to destroy Hyrax::AdministrativeSet: 124e88af-fc21-4a9c-aaee-d713d0bafbc1
…

♻️ This comment has been updated with latest results.

@kirkkwang kirkkwang force-pushed the add-local-controlled-vocabulary-validation branch from 74799f7 to 7b9f23a Compare May 1, 2026 16:54
kirkkwang added 2 commits May 1, 2026 17:40
The only defense against bad data for controlled vocabulary fields
exists in the frontend with the select options.  This commit will
introduce a validator for local controlled vocabulary terms by way of
Questioning Authority lookups which would ensure that anything
interacting directly with the backend would only be allowed to input
valid terms.
The reasoning is that some institutions may be adding to their
controlled vocabulary on a continous basis without adding it to their
backend each time.  The validation would break their workflow so instead
this will be an opt-in feature.
@kirkkwang kirkkwang force-pushed the add-local-controlled-vocabulary-validation branch from 62f46fc to c1d49aa Compare May 2, 2026 00:43
@kirkkwang kirkkwang marked this pull request as draft May 4, 2026 15:31
@kirkkwang kirkkwang marked this pull request as ready for review May 6, 2026 16:24
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.

1 participant