Whit 2073 access limit documents to named editors#11448
Draft
jamiestamp wants to merge 3 commits into
Draft
Conversation
As a boolean in MySQL is set up as a tinyint(1), we can set up the new options to extend what was already there. ------------------------------------- | DB | Before | After | | Value | migration | migration | |-----------------------------------| | 0 | False | disabled | | 1 | True | organisations | | 2 | | named_users | ------------------------------------- Taking this approach means we maintain the correct options when converting the column. Updates any references to the old values to `disabled` and `organisations` as needed. # Conflicts: # db/schema.rb
Introduces the `NamedAccess` model and corresponding migration to manage user access per edition. Ensures email presence, uniqueness within an edition, and valid email format.
Adds the "Limit access to named publishers" option to the access limiting form. Publishers can now restrict access to a draft to a list of email addresses, with the creating publisher always preserved on the list. `Edition::LimitedAccess` manages the list via the `named_accesses` association with autosave: assigning `access_limited_named_users=` builds and marks-for-destruction records eagerly so the persisted list always matches the input. `EditionRules#access_limit_enforced?` and `Admin::EditionFilter` are extended to enforce membership for the `named_users` mode, and `DraftEditionUpdater` skips its organisation-membership check for it. Co-authored-by: Alex Newton <alex.newton@digital.cabinet-office.gov.uk>
e41d3c6 to
2c38d60
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.
Adds the "Limit access to named publishers" option to the access limiting form. Publishers can now restrict access to a draft to a list of email addresses, with the creating publisher always preserved on the list.
Edition::LimitedAccessmanages the list via thenamed_accessesassociation with autosave: assigningaccess_limited_named_users=and marks-for-destruction records eagerly so the persisted list always matches the input.EditionRules#access_limit_enforced?and Admin::EditionFilterare extended to enforce membership for the named_usersmode, andDraftEditionUpdaterskips its organisation-membership check for it.