Create AccessLimitingOrganisations from Editions [WHIT-3534]#11548
Open
davidsauntson wants to merge 1 commit into
Open
Create AccessLimitingOrganisations from Editions [WHIT-3534]#11548davidsauntson wants to merge 1 commit into
AccessLimitingOrganisations from Editions [WHIT-3534]#11548davidsauntson wants to merge 1 commit into
Conversation
AccessLimitingOrganisations from EditionsAccessLimitingOrganisations from Editions [WHIT-3534]
ChrisBAshton
approved these changes
Jun 10, 2026
ChrisBAshton
left a comment
Contributor
There was a problem hiding this comment.
LGTM - one tweak below.
I'd hold off on merging until we're ready to switch on the feature flag to enable the UI view, as per the Release plan.
| errors << "Edition #{edition.id} cannot save new `AccessLimitingOrganisation` #{limiting_org.name}`: #{access_limiting_org.errors.full_messages.to_sentence}" | ||
| end | ||
|
|
||
| edition.access_limiting_organisations = access_limiting_orgs |
Contributor
There was a problem hiding this comment.
I'd move this outside of the block so we're not calling access_limiting_organisations= multiple times per edition
9f23e35 to
665b3ca
Compare
As part of the work to limit edition access to name individuals, the modelling for access limiting by organisation is changing. Now that the new `AccessLimitingOrganisation` model exists, we need to populate the db table with data from `Editions` who have `access_limiting` set to `organisations`, so that the new limiting logic has data to work with. This change introduces a data migration that creates a new `AccessLimitingOrganisation` entry for each edition lead and supporting organisation and saves it to the db.
665b3ca to
1c0a416
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
This change introduces a data migration that creates a new
AccessLimitingOrganisationentry for each edition lead and supporting organisation and saves it to the db.Why
As part of the work to limit edition access to named individuals, the modelling for access limiting by organisation is changing. Now that the new
AccessLimitingOrganisationmodel exists, we need to populate the db table with data fromEditionswho haveaccess_limitingset toorganisations, so that the new limiting logic has data to work with.This application is owned by the Whitehall Experience team. Please let us know in #govuk-whitehall-experience-tech when you raise any PRs.
Follow these steps if you are doing a Rails upgrade.