Skip to content

fix(config): parse UPDATE_DATASET_LIFECYCLE_GROUPS as string array#2724

Merged
alubbock merged 3 commits into
SciCatProject:masterfrom
rosalindfranklininstitute:fix/update-dataset-lifecycle-groups-parsing
May 19, 2026
Merged

fix(config): parse UPDATE_DATASET_LIFECYCLE_GROUPS as string array#2724
alubbock merged 3 commits into
SciCatProject:masterfrom
rosalindfranklininstitute:fix/update-dataset-lifecycle-groups-parsing

Conversation

@alubbock
Copy link
Copy Markdown
Member

@alubbock alubbock commented May 8, 2026

Description

The updateDatasetLifecycle access group was stored as a raw string rather than split into an array like every other group config entry. The CASL factory calls .includes() on this value to check membership; on a string, .includes() does substring matching, so a user in group "lifecycle" would pass the check when only "lifecycle-managers" is configured, granting unauthorised DatasetLifecycleUpdate access.

Adds a regression test that exercises the real configuration() function to catch any future reversion.

Changes:

  • Convert UPDATE_DATASET_LIFECYCLE_GROUPS from a comma-separated string of groups to an array
  • Add regression test

Tests included

  • Included for each change/fix?
  • Passing?

Summary by Sourcery

Ensure dataset lifecycle update access groups are parsed consistently with other group-based permissions to prevent unauthorized access.

Bug Fixes:

  • Parse UPDATE_DATASET_LIFECYCLE_GROUPS as a trimmed string array instead of a raw string to avoid substring-based authorization matches.

Tests:

  • Add a regression test around the CASL ability factory using the real configuration() to verify correct handling of dataset lifecycle update groups.

The updateDatasetLifecycle access group was stored as a raw string
rather than split into an array like every other group config entry.
The CASL factory calls .includes() on this value to check membership;
on a string, .includes() does substring matching, so a user in group
"lifecycle" would pass the check when only "lifecycle-managers" is
configured, granting unauthorised DatasetLifecycleUpdate access.

Adds a regression test that exercises the real configuration() function
to catch any future reversion.
@alubbock alubbock requested a review from a team as a code owner May 8, 2026 17:11
Copy link
Copy Markdown

@sourcery-ai sourcery-ai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey - I've reviewed your changes and they look great!


Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

Copy link
Copy Markdown
Member

@Junjiequan Junjiequan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@alubbock alubbock enabled auto-merge May 19, 2026 08:40
@alubbock alubbock merged commit 52f8b86 into SciCatProject:master May 19, 2026
15 checks passed
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.

2 participants