Skip to content

clinnova#71

Draft
aleuk0 wants to merge 7 commits intodevelopfrom
clinnova
Draft

clinnova#71
aleuk0 wants to merge 7 commits intodevelopfrom
clinnova

Conversation

@aleuk0
Copy link
Copy Markdown
Collaborator

@aleuk0 aleuk0 commented Mar 10, 2026

1. Multi-instance REMS support (__init__.py, rems_oidc_handler.py, multiple_rems_handler.py)

  • New: MultipleRemsAccessHandler — routes REMS API calls to the correct instance (REMS_INSTANCES config) based on dataset.instance_id
  • New: MultipleRemsOidcAccessHandler — same, but with OIDC-based access check (from token accesses) on top
  • get_access_handler() now auto-selects the Multiple* variant when CONNECTED_INSTANCES is configured

2. Multi-instance Daisy import (daisy_connector.py, commands.py)

  • DaisyConnector gains an instance_id parameter, which is stamped on each imported entity
  • New _build_separate_dataset() internal builder for plugin Dataset subclasses (handles isnan float values from metadata)
  • Removed field hardcoding (description, deprecated, released_on, request_pdf_enabled) from the common builder — now comes entirely from metadata JSON
  • get_importer_connector() renamed to get_importer_connectors() → now returns a list; CLI index/delete commands loop over all connectors
  • Daisy connector instantiation in CLI now loops over CONNECTED_INSTANCES → creates one DaisyConnector per instance

3. Multi-instance REMS export (commands.py)

  • export CLI command now loops over CONNECTED_INSTANCES, filters entities by instance_id, and exports each group to its own REMS connector

4. Access caching on search (web_controllers.py)

  • update_users_accesses() — on every search page load, checks approved REMS access for the current user across all entities and syncs access_granted_users field in Solr (used for faceting/filtering)
  • Search results now include has_access dict (per entity) passed to the template
  • access_granted_users facet is filtered to only show the current user's own count

5. JSON export endpoint (web_controllers.py)

  • New route GET /e/<entity_name>/<entity_id>/export_json_entity — exports entity as a downloadable JSON file

6. Config template (settings.py.template)

  • Added CONNECTED_INSTANCES, DAISY_INSTANCES, and REMS_INSTANCES config keys

@aleuk0 aleuk0 requested a review from moustaphacheikh March 10, 2026 11:56
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