New: Add access widget for _access sharing (fixes #486)#490
Merged
Conversation
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.
Fixes #486
New
Accessbackbone-forms editor (app/modules/scaffold/views/scaffoldAccessView.js) that renders one exclusive-tier sharing control over the flat_accessobject, replacing the legacy_isShared/_shareWithUsersfields:{ public: false }{ public: false, users: [...] }(Selectize people picker overGET api/users, reusing the existingscaffoldUsersOptiontemplate){ public: true }(clear-on-public: the in-memory people list is cleared; nothing is auto-saved)_accesskeys are preserved on save.app/modules/scaffold/lang/en.json(app.scaffold.access.*)._access.groups) are intentionally out of scope for this UI.Update
app/modules/scaffold/index.jsgetTypenow honours the canonical schema annotation_adapt.inputType(in addition to the legacy_backboneForms) when resolving an editor. The_accessfield is expected to carry_adapt.inputType: "Access"in its served schema — the UI does not force a_backboneFormstype client-side._isShared/_shareWithUsersare hidden viaATTRIBUTE_BLACKLISTso they don't render alongside the widget during the cutover (the fields stay in the DB, readable, until the later contract step)._accessinstead of the legacy fields:courseModel.isEditable(app/core/models/courseModel.js) and the shared-project delete prompt (app/modules/projects/views/projectView.js).Testing
npx standard— passes (app/is excluded from the standard config; all editor changes live there).npm test— 60/60 pass (the suite covers the Node build/liblayer, which is untouched)._isShared/_shareWithUsersfields when_accessis absent, so it works before and after the backfill migration._accessonly appears in the course schema once the enforcement chain lands (New: Extend _access with users key adapt-authoring-users#46_access.users, New: Enable access control adapt-authoring-content#117 opt-in, Update: Remove checkContentAccess in favour of generic _access adapt-authoring-adaptframework#194 remove legacy paths + backfill). Do not merge/deploy ahead of that chain or sharing toggles will write a field nothing reads.Depends on (schema)
_accessschema must annotate the field with_adapt.inputType: "Access"(and ideally atitle/descriptionfor the section heading and help text). This is the schema-side counterpart to thegetTypechange above and should land with the cutover.