Skip to content

added ability to set grid authorization type field to CurationTask#1392

Open
andrewelamb wants to merge 19 commits into
developfrom
SYNPY-1849
Open

added ability to set grid authorization type field to CurationTask#1392
andrewelamb wants to merge 19 commits into
developfrom
SYNPY-1849

Conversation

@andrewelamb

@andrewelamb andrewelamb commented May 29, 2026

Copy link
Copy Markdown
Contributor

Problem:

Curation grid sessions could only be created with the default authorization behavior, where the user who creates the session becomes its owner (SESSION_OWNER). There was no way to:

  • Configure a CurationTask to recommend a particular authorization mode for the grid sessions opened against it.
  • Create a Grid session with SOURCE_BENEFACTOR authorization, which lets anyone with EDIT permission on the source data collaborate in the same session without being added to a shared ownership team.

The affected code is the curation/grid model layer (synapseclient/models/curation.py) and the curator extension task helpers, which previously had no concept of an authorization mode.

Solution:

Added support for the grid authorizationMode field throughout the curation/grid models:

  • Introduced a new AuthorizationMode enum (SESSION_OWNER, SOURCE_BENEFACTOR) mirroring the Synapse REST AuthorizationMode type, exported from synapseclient.models.
  • Added a suggested_authorization_mode field (plus the not-yet-active collaborator_principal_ids) to FileBasedMetadataTaskProperties and RecordBasedMetadataTaskProperties.
  • Added an authorization_mode field to Grid and CreateGridRequest, and wired it through create_async / to_synapse_request so it is sent at session-creation time and populated back from the response.
  • When a CurationTask creates a new grid session, it now forwards task_properties.suggested_authorization_mode to the Grid.
  • The curator extension task helpers (file_based_metadata_task.py, record_based_metadata_task.py) accept and pass through the suggested authorization mode.

Design notes / side effects:

  • to_synapse_request for the task properties was switched to build a full dict and then strip None keys via delete_none_keys, instead of conditionally adding keys.
  • owner_principal_id is now coerced to int when populated from API responses, fixing a type inconsistency.
  • Documentation was updated in the metadata curation guide and the curator API reference pages.

Testing:

  • Added unit tests verifying that CurationTask passes the correct authorization parameters when creating a grid session, and that the task properties / grid serialize and deserialize authorizationMode correctly (tests/unit/synapseclient/models/async/unit_test_curation_async.py, tests/unit/synapseclient/extensions/unit_test_curator.py).
  • Added integration tests covering the new authorization mode behavior for grids and curation tasks (tests/integration/.../models/async/test_grid_async.py, test_curation_async.py).

@andrewelamb andrewelamb requested a review from a team as a code owner May 29, 2026 16:41
@andrewelamb andrewelamb marked this pull request as draft May 29, 2026 16:41
@andrewelamb andrewelamb marked this pull request as ready for review June 17, 2026 17:33
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